Q:

in Pandas how to get a UTC TimeStamp (at a given hour) from a DateTime?

I have a variable in my dataframe that looks like
Day
2015-01-01
2015-02-01

I would like to generate a time variable that gives me the UTC timestamp of the corresponding EST timestamp of the day in Day at 9:00 am in the morning (always 9am, dont ask why...).
Precisely, considering the output for row one,I mean going from 2015-01-01 to 2015-01-01 9:00 EST to 2015-01-01 14:00 UTC. How can I do that in Pandas?
Thanks!

A:

df.Day = pd.date_range('1/1/2015 09:00', periods=10, freq='D')
df.Day = df.Day.tz_localize('UTC')
df.Day_converted = df.Day.tz_convert('US/Eastern')

After creating the timeseries you can localize it to a zone with .tz_localize and then convert it.

A:

thats probably the better solution
df['time']=df['Day'].apply(lambda x: x + ' 9:00')
df['time_utc']=df['time'].apply(lambda x: `pd.Timestamp(x).tz_localize('US/Eastern').tz_convert('UTC'))`

