Closed
Description
Opening an issue mostly so the upcoming PR can reference it. This is in fact already fixed in master (at least as of 9303315), so the PR is just a test.
Setup:
dti = pd.date_range('1999-09-30', periods=10, tz='US/Pacific')
ser = pd.Series(dti)
0.22.0:
>>> ser - dti
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/site-packages/pandas/core/ops.py", line 720, in wrapper
converted = _Op.get_op(left, right, name, na_op)
File "/usr/local/lib/python2.7/site-packages/pandas/core/ops.py", line 349, in get_op
return _TimeOp(left, right, name, na_op)
File "/usr/local/lib/python2.7/site-packages/pandas/core/ops.py", line 385, in __init__
self._validate(lvalues, rvalues, name)
File "/usr/local/lib/python2.7/site-packages/pandas/core/ops.py", line 444, in _validate
raise ValueError("Incompatible tz's on datetime subtraction "
ValueError: Incompatible tz's on datetime subtraction ops
>>> dti - ser
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/site-packages/pandas/core/ops.py", line 720, in wrapper
converted = _Op.get_op(left, right, name, na_op)
File "/usr/local/lib/python2.7/site-packages/pandas/core/ops.py", line 349, in get_op
return _TimeOp(left, right, name, na_op)
File "/usr/local/lib/python2.7/site-packages/pandas/core/ops.py", line 385, in __init__
self._validate(lvalues, rvalues, name)
File "/usr/local/lib/python2.7/site-packages/pandas/core/ops.py", line 444, in _validate
raise ValueError("Incompatible tz's on datetime subtraction "
ValueError: Incompatible tz's on datetime subtraction ops