Skip to content

BUG: insert NaT into tz-aware DTI. #16357

Closed
@jreback

Description

@jreback

this should work (also should test for other index reshaping ops) & for TDI and PI

In [7]: pd.DatetimeIndex(['2017-01-01']).insert(0, pd.NaT)
Out[7]: DatetimeIndex(['NaT', '2017-01-01'], dtype='datetime64[ns]', freq=None)

In [8]: pd.DatetimeIndex(['2017-01-01'], tz='UTC').insert(0, pd.NaT)
ValueError: Passed item and index have different timezone

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugDatetimeDatetime data dtypeReshapingConcat, Merge/Join, Stack/Unstack, ExplodeTimezonesTimezone data dtype

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions