Outline

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

去掉分钟精度

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

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

padnas 版本 要大于等于 0.15.0

相关文章:

  • 2022-12-23
  • 2021-12-12
  • 2021-05-27
  • 2022-12-23
  • 2022-03-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-15
  • 2021-10-23
  • 2021-09-16
  • 2021-07-22
  • 2022-12-23
  • 2021-07-19
  • 2021-07-03
相关资源
相似解决方案