I have a dataframe like below:
d={
'Date' :['2016-10-30','2016-10-30','2016-11-01','2016-10-30'],
'Time':['09:58:11', '10:05:34', '10:07:57', '11:15:32'],
'Transaction':[2,3,1,1]
}
df=pd.DataFrame(d, columns=['Date','Time','Transaction'])
I need to create a new variable as Time_Group. For (6,11] is 'Morning' ,for (11,17] is 'Afternoon' and for (17,20] is 'Evening' for data of Time_group. How to sub create this variable by using Time column?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…