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_timedelta
and then extracthour
:Another solution with
split
and cast toint
:Solution with
extract
and cast toint
:Solution with convert
to_datetime
:Timings: