Skip to content

argmin/argmax, idxmin/idxmax and datetime64 #2982

Closed
@lodagro

Description

@lodagro
In [65]: s
Out[65]: 
a   2013-01-02 00:00:00
b   2013-01-03 00:00:00
c   2013-01-04 00:00:00
d   2013-01-05 00:00:00
e                   NaT
dtype: datetime64[ns]

In [66]: s.argmin()
Out[66]: 4

In [67]: s.idxmin()
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
...
TypeError: ufunc 'isfinite' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule 'safe'

In [68]: s.argmax()
Out[68]: 3

In [69]: s.idxmax()
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
...
TypeError: ufunc 'isfinite' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule 'safe'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions