【发布时间】:2019-03-14 19:25:18
【问题描述】:
我有一个熊猫数据框,其中有一列日期格式如下:
PublishDateTime= 2018-08-31 12:00:00-UTC
我使用 panda to_gbq() 函数将数据转储到 bigquery 表中。在转储数据之前,我确保列的格式与表方案匹配。 publishate 是 bigquery 表中的时间戳。如何实现类似于:
df['PublishDateTime'] = df['PublishDateTime'].astype('?????')
我试过datetime[ns],但没用!
【问题讨论】:
标签: python pandas date datetime dataframe