Let's say I have a dataframe with two columns, a naive date, and it's corresponding timezone. I'd like to convert the naive date to a timezone aware date using the second column.
Pablo's answer was spot on, this is what I ended up using:
df['local_date'] = df.apply(lambda x: x['naive_date'].tz_localize(tz=x['timezone']), axis=1)
2.1m questions
2.1m answers
60 comments
57.0k users