Hi all is it possible to get part of the day (morning, noon, afternoon, ...) directly from datetime column in a dataframe using Pandas? For example for day of the week it's possible to do:
df['weekday']= df.date.dt.day_name()
and it returns: Monday, Tuesday, ... Is there something similar available in Pandas for part of the day? For example:
df['part of day']= df.date.dt.day_part()
Notice: I am not looking for an answer like this link which you write the function yourself: Get part of day (morning, afternoon, evening, night) in Python dataframe