Skip to content

BUG: to_timedelta('NaT', box=False) returns datetime64('NaT') #24957

Closed
@shoyer

Description

@shoyer

On pandas 0.23 (correct):

In [2]: pd.to_timedelta('NaT', box=False)
Out[2]: numpy.timedelta64('NaT','ns')

But on pandas 0.24:

In [2]: pd.to_timedelta('NaT', box=False)
Out[2]: numpy.datetime64('NaT')

The result is a datetime, not a timedelta.

Metadata

Metadata

Assignees

No one assigned

    Labels

    RegressionFunctionality that used to work in a prior pandas versionTimedeltaTimedelta data type

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions