I have a timestamp_time
column in a DataFrame (in string format)
timestamp_time
11:59 AM
5:06 AM
11:04 PM
5:06 PM
....
....
12:00 AM
12:01 PM
I want to bin the values in these range (inclusive)
morning -> 5AM to 11:59AM
afternoon ->12PM to 4:59PM
evening -> 5PM to 8:59PM
night -> 9PM to 11:59PM
midnight -> 12AM to 4:59AM
I want to generate a new time_of_the_day
column based on the value (and the mentioned range) from timestamp_time
column
The Output will be like this
time_of_the_day
morning
morning
night
evening
....
....
midnight
afternoon
I converted the timestamp_time
to 24-hour time format
What to do next?