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

DatetimeIndex comparison tzaware vs naive should raise #18162

Closed
jbrockmendel opened this Issue Nov 8, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@jbrockmendel
Member

jbrockmendel commented Nov 8, 2017

>>> dr = pd.date_range('2016-01-01', periods=6)
>>> dz = dr.tz_localize('US/Pacific')
>>> dr < dz
array([ True,  True,  True,  True,  True,  True], dtype=bool)
>>> dr[0] < dz[0]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "pandas/_libs/tslib.pyx", line 1169, in pandas._libs.tslib._Timestamp.__richcmp__
  File "pandas/_libs/tslib.pyx", line 1230, in pandas._libs.tslib._Timestamp._assert_tzawareness_compat
TypeError: Cannot compare tz-naive and tz-aware timestamps

The vectorized comparison should raise too right?

@jreback

This comment has been minimized.

Contributor

jreback commented Nov 8, 2017

yes this should raise

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment