-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
DatetimeDatetime data dtypeDatetime data dtypePerformanceMemory or execution speed performanceMemory or execution speed performance
Milestone
Description
In [5]: index = pd.Index([pd.Timestamp('2001'), pd.Timestamp('2002')], dtype=object)
In [6]: pd.Series(1, index=index).index
Out[6]: DatetimeIndex(['2001-01-01', '2002-01-01'], dtype='datetime64[ns]', freq=None)
This was the root cause of #23591. Why are we doing that?
Note that this doesn't affect the case of index=[pd.Timestamp(...), pd.Timestamp(...)]
, as that would have previously been converted to a DatetimeIndex. It seems be only when you have an Index of datetimes.
I'm going through our test cases that hit this now.
Metadata
Metadata
Assignees
Labels
DatetimeDatetime data dtypeDatetime data dtypePerformanceMemory or execution speed performanceMemory or execution speed performance