Here is the snippet:
test = pd.DataFrame({\'days\': [0,31,45]}) test[\'range\'] = pd.cut(test.days, [0,30,60])
Output:
A sample of how the .cut works
s=pd.Series([168,180,174,190,170,185,179,181,175,169,182,177,180,171) pd.cut(s,3) #To add labels to bins pd.cut(s,3,labels=["Small","Medium","Large"])
This can be used directly on a range