-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Timestamp and DatetimeIndex construct different timezones #23815
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
DatetimeIndex (via, DatetimeArrayMixin) goes tz = timezones.maybe_get_tz(tz)
result._tz = timezones.tz_standardize(tz)
So it seems like I should be using |
Can you show the tzinfo objects? Tzinfo equality comparisons have weird semantics. |
In [2]: a = pd.Timestamp('2000', tz='US/Central')
In [3]: b = pd.DatetimeIndex(['2000'], tz='US/Central')
In [4]: a.tz
Out[4]: <DstTzInfo 'US/Central' CST-1 day, 18:00:00 STD>
In [5]: b.tz
Out[5]: <DstTzInfo 'US/Central' LMT-1 day, 18:09:00 STD> Just to be clear, this came from a base ExtensionArray test. If this comes down to "timezones are weird" I'm happy to note that in the docs and skip the test. |
These are expected to be unequal due to pytz semantics. For a pytz timezone with a For a pytz timezone with a |
Fun... I'll try to turn this into a new docs section in http://pandas-docs.github.io/pandas-docs-travis/timeseries.html#working-with-time-zones Should we add |
Yeah clarifying this pytz idiosyncrasy in the docs would be a nice addition. @jbrockmendel is the spec for |
To see if they represent the same timezone. |
Gotcha. My impression was that |
Question in the form of an issue: is this a bug?
This leads to strange things like
The text was updated successfully, but these errors were encountered: