Skip to content

API/BUG: DatetimeIndex.argsort does not match DatetimeArray.argsort #37863

Closed
@jbrockmendel

Description

@jbrockmendel

The DatetimeIndex returns self.asi8.argsort(*args, **kwargs), while the DatetimeArray uses the M8[ns] values. This puts NaTs at the front for DTI and the end for DTA.

Changing the DTI method (actually the DTI/TDI/PI methods) to match their array counterparts breaks 12 tests, 11 of them resample, 1 test_grouping.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugNeeds TriageIssue that has not been reviewed by a pandas team member

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions