Series.idxmax() and Series.max() show inconsistent behaviour with pd.np.Inf #13880
Labels
Bug
Duplicate Report
Duplicate issue or pull request
Indexing
Related to indexing on series/frames, not to indexes themselves
Numeric Operations
Arithmetic, Comparison, and Logical operations
idxmax
is supposed to return the index of the maximum element. However, it seems to ignore special values like infinity (pd.np.Inf
), leading to the following inconsistency:This snippet will return
False
, sinces.idxmax()
will return1
, the index of value5
, whiles.max()
returnsInf
as expected.Expected Output
True
output of
pd.show_versions()
The text was updated successfully, but these errors were encountered: