更新时间:2023-02-03 23:33:58
使用pandas datetools解析器解析日期,然后使用标准的python strftime
函数将其格式化.
Use the pandas datetools parser to parse the date and then format it using the standard python strftime
function.
>>> df['q_date'].apply(
lambda x: pd.datetools.parse(x).strftime('%Y-%m-%dT%H:%M%:%SZ'))
0 20120210T00:0000Z
1 20120210T00:0000Z
2 20120210T00:0000Z
3 20120210T00:0000Z
4 20120210T00:0000Z
Name: q_date, dtype: object