How to remove the date information in a column, just keep time

后端 未结 6 753
情深已故
情深已故 2020-12-19 01:54

I am using pandas dataframe. there is a specific column has time information.

the raw data likes this:

5:15am
5:28am
6:15am

so I ne

6条回答
  •  失恋的感觉
    2020-12-19 02:34

    Just use the datetime.time() function

    datetime.time()
    Return time object with same hour, minute, second and microsecond. tzinfo is None. See also method timetz().

    This will return a datetime.time object and you can access the data with the time.hour time.minute and time.second attributes.

提交回复
热议问题