转换为
Timedelta并从中提取总秒数
dt.total_seconds:
df date0 2013-01-011 2013-01-022 2013-01-033 2013-01-044 2013-01-055 2013-01-066 2013-01-077 2013-01-088 2013-01-099 2013-01-10pd.to_timedelta(df.date).dt.total_seconds()0 1.356998e+091 1.357085e+092 1.357171e+093 1.357258e+094 1.357344e+095 1.357430e+096 1.357517e+097 1.357603e+098 1.357690e+099 1.357776e+09Name: date, dtype: float64
或者,将数据作为一种
int类型显示可能会更有用:
pd.to_timedelta(df.date).dt.total_seconds().astype(int)0 13569984001 13570848002 13571712003 13572576004 13573440005 13574304006 13575168007 13576032008 13576896009 1357776000Name: date, dtype: int64
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)