You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This allows you to pass a unit (which defaults to ns)
In [7]: pd.to_datetime(pd.Index(val))
Out[7]: DatetimeIndex(['2018-01-01'], dtype='datetime64[ns]', freq=None)
We do allow an int64 array to be directly converted, it is assumed to be in ns
In [11]: pd.DatetimeIndex(pd.Index(val).values)
Out[11]: DatetimeIndex(['2018-01-01'], dtype='datetime64[ns]', freq=None)
So no real objection to allowing an Int64Index in the DTI constructor. I suppose even in .astype it is ok. Though user facing conversions should always be in to_datetime.
Is there a historical reason why an Int64Index (defaulting to represent epoch timestamps) cannot be converted to a DatetimeIndex?
The text was updated successfully, but these errors were encountered: