Answers for "pandas from timestamp to datetime"

0

from unix timestamp to datetime pandas

# convert unix timestamp to datetime UTC
df['datetime'] = df['_ts'].map(lambda x: pendulum.from_timestamp(x)) 
df = df.set_index('datetime')
# convert timezone from UTC to GMT+7
df.index = df.index.tz_convert('Asia/Bangkok')
Posted by: Guest on June-14-2021

Code answers related to "pandas from timestamp to datetime"

Python Answers by Framework

Browse Popular Code Answers by Language