Skip to content

Series.max incorrect for skipna=False with missing datetime64[ns] data. #24265

Closed
@TomAugspurger

Description

@TomAugspurger
In [2]: s = pd.Series([1, None, 3], dtype='datetime64[ns]')

In [3]: s.max(skipna=False)
Out[3]: Timestamp('1970-01-01 00:00:00.000000003')

That should be NaT.

We get min correct, but think just because iNaT is already the min.

Probably affects datetimetz / timedelta as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DatetimeDatetime data dtypeNumeric OperationsArithmetic, Comparison, and Logical operations

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions