>>> series = pd.Series(pd.date_range('2015-1-1 1:30', periods=3, freq='min'))
>>> series
0 2015-01-01 01:30:00
1 2015-01-01 01:31:00
2 2015-01-01 01:32:00
dtype: datetime64[ns]
If I want those values localised and then converted, I'd assume I could do:
>>> series.tz_localize('America/Chicago').tz_convert('Europe/London')
Traceback (most recent call last):
...
TypeError: index is not a valid DatetimeIndex or PeriodIndex
The closest I can find is:
>>> series.apply(lambda x: x.tz_localize('America/Chicago').tz_convert('Europe/London'), convert_dtype=False)
0 2015-01-01 07:30:00+00:00
1 2015-01-01 07:31:00+00:00
2 2015-01-01 07:32:00+00:00
dtype: object
But, as you can see, this changes the dtype. It's also painfully slow on any reasonable size frame.
What should I be doing?
Chris
--
You received this message because you are subscribed to the Google Groups "PyData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pydata+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.