I have a pandas Series with values of type datetime64[ns]. The dates are in EST timezone, and I would like to convert them to UTC timezone.
E.g.,
s=pd.Series(pd.date_range('2012-1-1 1:30',periods=3,freq='min'))
How to convert s to UTC?
(Note that I don’t actually use date_range() so using its tz parameter is not an option.)
Update: In recent pandas, you can use the dt accessor to broadcast this:
Here’s one way (depending if tz is already set it might be a
tz_convertrather thantz_localize):