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
>>> dti = pd.date_range('2016-01-01', periods=3, tz='US/Central')
>>> pd.DatetimeIndex(dti, tz='Asia/Tokyo')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/site-packages/pandas/core/indexes/datetimes.py", line 413, in __new__
raise TypeError(msg.format(data.tz, tz))
TypeError: data is already tz-aware US/Central, unable to set specified tz: Asia/Tokyo
It isn't clear to me that raising is the right thing to do; shouldn't this just be equivalent to dti.tz_convert('Asia/Tokyo')? Or is this ambiguous for some reason?
The text was updated successfully, but these errors were encountered:
This works for Timestamp albeit I am not really a fan of tz= meaning localizing and converting. But if this is properly documented, we might as well follow Timestamp's behavior unless I am missing something
In [1]: pd.Timestamp(pd.Timestamp('2016-01-01', tz='US/Central'), tz='Asia/Tokyo')
Out[1]: Timestamp('2016-01-01 15:00:00+0900', tz='Asia/Tokyo')
At the moment the following raises:
It isn't clear to me that raising is the right thing to do; shouldn't this just be equivalent to
dti.tz_convert('Asia/Tokyo')
? Or is this ambiguous for some reason?The text was updated successfully, but these errors were encountered: