How do I convert dates in a Pandas data frame to a 'date' data type?

前端 未结 10 2223
独厮守ぢ
独厮守ぢ 2020-11-28 02:56

I have a Pandas data frame, one of the column contains date strings in the format YYYY-MM-DD

For e.g. \'2013-10-28\'

At the moment th

10条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-28 03:45

    Now you can do df['column'].dt.date

    Note that for datetime objects, if you don't see the hour when they're all 00:00:00, that's not pandas. That's iPython notebook trying to make things look pretty.

提交回复
热议问题