I have the following data frame:
Day_Part Start_Time End_Time
Breakfast 9:00 11:00
Lunch 12:00 14:00
Dinner 19:00 23:00
The columns Start_Time and End_time are 'Series Objects' right now. I want to convert the values in those columns into int64 dtype.
This is what I want the data frame to look like:
Day_Part Start_Time End_Time
Breakfast 9 11
Lunch 12 14
Dinner 19 23
*Any help is greatly appreciated.
You can first convert
to_timedeltaand then extracthour:Another solution with
splitand cast toint:Solution with
extractand cast toint:Solution with convert
to_datetime:Timings: