1X_train_data = pd.DataFrame({'Age':[0,2,4,13,35,-1,54]})
2
3bins= [0,2,4,13,20,110]
4labels = ['Infant','Toddler','Kid','Teen','Adult']
5X_train_data['AgeGroup'] = pd.cut(X_train_data['Age'], bins=bins, labels=labels, right=False)
6print (X_train_data)
7 Age AgeGroup
80 0 Infant
91 2 Toddler
102 4 Kid
113 13 Teen
124 35 Adult
135 -1 NaN
146 54 Adult