yijia2413 / collections

useful collections from the Internet.
MIT License
0 stars 0 forks source link

Pandas高阶 #4

Open yijia2413 opened 4 years ago

yijia2413 commented 4 years ago

timestamp 转成 datetime 并替换时区

df['collect_time'] = pd.to_datetime(df['collect_time'], unit='s').dt.tz_convert('Asia/Shanghai').dt.strftime('%Y-%m-%d %H:%M:%S%z')