df['Age_Group'] = '<40'
df.loc[df['Age'] < 40, 'Age_Group'] = '<40'
df.loc[(df['Age'] > 18) & (df['Age'] < 40), 'Age_Group'] = '>18'
df.loc[df['Age'] < 18, 'Age_Group'] = '<18'
df
Кадр данных Pandas добавляет поле на основе нескольких операторов if