d = {'Age': pd.Series([36.0, 42.0, 6.0, 66.0, 38.0])}
df = pd.DataFrame(d)
df
df['Age_Group'] = '<40'
df['Age_Group'][df['Age'] > 40] = '>40'
df['Age_Group'][(df['Age'] > 18) & (df['Age'] < 40)] = '>18'
df['Age_Group'][df['Age'] < 18] = '<18'
df
Pandas dataframe add a field based on multiple if statements