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
The .tz on a Timestamp can differ from the .tz on the array / index it's contained within
In [5]: idx=pd.date_range('2000', periods=4, tz="US/Central")
In [6]: idx.tzOut[6]: <DstTzInfo'US/Central'LMT-1day, 18:09:00STD>In [7]: idx[0].tzOut[7]: <DstTzInfo'US/Central'CST-1day, 18:00:00STD>
I gather that this is the correct behavior. My question: since DatetimeTZDtype is only really used when attached to an array, should it automatically normalize the user-provided tz to the version that's attached to the array? In code, both of the following
In [11]: pd.DatetimeTZDtype(tz=idx.tz).tzOut[11]: <DstTzInfo'US/Central'LMT-1day, 18:09:00STD>In [12]: pd.DatetimeTZDtype(tz=idx[0].tz).tzOut[12]: <DstTzInfo'US/Central'CST-1day, 18:00:00STD>
would be equal to the normalized version, Out[11].
The
.tz
on aTimestamp
can differ from the.tz
on the array / index it's contained withinI gather that this is the correct behavior. My question: since DatetimeTZDtype is only really used when attached to an array, should it automatically normalize the user-provided
tz
to the version that's attached to the array? In code, both of the followingwould be equal to the normalized version,
Out[11]
.originally suggested by @jbrockmendel. cc @mroeschke.
The text was updated successfully, but these errors were encountered: