Unable to apply methods on timestamps using Series built-ins

As Jeff’s answer mentions, tz_localize() and tz_convert() act on the index, not the data. This was a huge surprise to me too.

Since Jeff’s answer was written, Pandas 0.15 added a new Series.dt accessor that helps your use case. You can now do this:

pd.to_datetime(my_series, unit="ms").dt.tz_localize('UTC').dt.tz_convert('US/Eastern')

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)