pandas.to_datetime() 只保留【年-月-日】

Outline

pandas.to_datetime()  生成的日期会默认带有 【2019-07-03 00:00:00】的分钟精度;
但有时并不需要这些分钟精度;

去掉分钟精度

可以通过pandas中的 .dt.date 去掉分钟。

df['just_date'] = df['dates'].dt.date

padnas 版本 要大于等于 0.15.0

posted @ 2019-07-03 15:37  ZhuGaochao  阅读(18123)  评论(0)    收藏  举报