Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Series.argmax and Series.idxmax ignore numpy.inf values #14589

Closed
JasonKessler opened this issue Nov 4, 2016 · 1 comment
Closed

Series.argmax and Series.idxmax ignore numpy.inf values #14589

JasonKessler opened this issue Nov 4, 2016 · 1 comment
Labels
Bug Duplicate Report Duplicate issue or pull request

Comments

@JasonKessler
Copy link

JasonKessler commented Nov 4, 2016

A small, complete example of the issue

>>> series = pd.Series({'a':3, 'b':7, 'c':np.inf, 'd':6})
>>> series.argmax() # should be c
'b'
>>> series.idxmax() # should be c
'b'
>>> series.max() # this works properly
inf
>>> series.index[np.argmax(np.array(series))] # this work-around works
'c'

Expected Output

>>> series = pd.Series({'a':3, 'b':7, 'c':np.inf, 'd':6})
>>> series.argmax()
'c'
>>> series.idxmax()
'c'

Output of pd.show_versions()

# Paste the output here pd.show_versions() here ```python >>> pd.show_versions()

INSTALLED VERSIONS

commit: None
python: 3.5.2.final.0
python-bits: 64
OS: Darwin
OS-release: 15.6.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: en_US.UTF-8

pandas: 0.19.0
nose: 1.3.7
pip: 8.1.2
setuptools: 23.0.0
Cython: 0.24
numpy: 1.11.2
scipy: 0.18.1
statsmodels: 0.6.1
xarray: None
IPython: 4.2.0
sphinx: 1.4.1
patsy: 0.4.1
dateutil: 2.5.3
pytz: 2016.7
blosc: None
bottleneck: 1.1.0
tables: 3.2.2
numexpr: 2.6.0
matplotlib: 1.5.1
openpyxl: 2.3.2
xlrd: 1.0.0
xlwt: 1.1.2
xlsxwriter: 0.9.2
lxml: 3.6.0
bs4: 4.4.1
html5lib: None
httplib2: 0.9.2
apiclient: None
sqlalchemy: 1.0.13
pymysql: None
psycopg2: 2.6.2 (dt dec pq3 ext lo64)
jinja2: 2.8
boto: 2.40.0
pandas_datareader: None

</details>
@chris-b1
Copy link
Contributor

chris-b1 commented Nov 4, 2016

Thanks for the report - this a duplicate of #13595 - PR to fix welcome!

@chris-b1 chris-b1 closed this as completed Nov 4, 2016
@chris-b1 chris-b1 added the Duplicate Report Duplicate issue or pull request label Nov 4, 2016
@chris-b1 chris-b1 added this to the No action milestone Nov 4, 2016
@chris-b1 chris-b1 added the Bug label Nov 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Duplicate Report Duplicate issue or pull request
Projects
None yet
Development

No branches or pull requests

2 participants