I have a dataframe like the following
(我有一个如下的数据框)
print (df)
T
0 1573119509
1 1573119512
2 1573119517
3 1573119520
I would like to convert the column T
to a date.
(我想将T
列转换为日期。)
This is what I am doing: (这就是我在做什么:)
df['Td'] = pd.to_datetime(df['T']).apply(lambda x: x.date())
but it returns:
(但它返回:)
print (df)
T Td
0 1573119509 1970-01-01
1 1573119512 1970-01-01
2 1573119517 1970-01-01
3 1573119520 1970-01-01
ask by emax translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…