We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
If I run
pd.to_datetime('now') == pd.to_datetime('now', utc=True)
or
pd.Timestamp('now', tz='utc') == pd.Timestamp('now')
I get
TypeError: Cannot compare tz-naive and tz-aware timestamps
which makes sense.
However if I compare a tz-naive DatetimeIndex og Series with a tz-aware timestamp I dont get an error
In[1]: date Out[1]: Timestamp('2016-01-05 00:00:00+0000', tz='UTC') In[2]: pd.to_datetime(['2012-01-06T00:00:00.000000000', '2013-01-08T00:00:00.000000000', '2014-01-07T00:00:00.000000000', '2015-01-06T00:00:00.000000000', '2016-01-05T00:00:00.000000000']) == date Out[2]: array([False, False, False, False, True]) In[3]: pd.Series(pd.to_datetime(['2012-01-06T00:00:00.000000000', '2013-01-08T00:00:00.000000000', '2014-01-07T00:00:00.000000000', '2015-01-06T00:00:00.000000000', '2016-01-05T00:00:00.000000000'])) == date Out[3]: 0 False 1 False 2 False 3 False 4 True dtype: bool
and if I compare a datetime64[ns] numpy array to the tz-aware timestamp I also dont get an error, plus I get wrong results:
In[4]: pd.to_datetime(['2012-01-06T00:00:00.000000000', '2013-01-08T00:00:00.000000000', '2014-01-07T00:00:00.000000000', '2015-01-06T00:00:00.000000000', '2016-01-05T00:00:00.000000000']).values == date Out[4]: array([False, False, False, False, False])
I am running: pandas: 0.22.0 numpy: 1.14.0 pytz: 2017.3 python: 3.6.3
on ubuntu 16.04
The text was updated successfully, but these errors were encountered:
There's been a lot of work on this recently. Comparing a tz-naive and tz-aware datetimeindex now raises on master: #18376
Sorry, something went wrong.
No branches or pull requests
If I run
or
I get
which makes sense.
However if I compare a tz-naive DatetimeIndex og Series with a tz-aware timestamp I dont get an error
and if I compare a datetime64[ns] numpy array to the tz-aware timestamp I also dont get an error, plus I get wrong results:
I am running:
pandas: 0.22.0
numpy: 1.14.0
pytz: 2017.3
python: 3.6.3
on ubuntu 16.04
The text was updated successfully, but these errors were encountered: