def rings_label(x): if x<=10: return 'young' if x<=20: return 'middle age' if x<=30: return 'old' df['Rings'] = df['Rings'].apply(rings_label)