I have a column called trip_cost
and I want to create a new column called level
.
I am doing this:
df['level'] = ''
for i in df.trip_cost:
if i < 65.0:
df['Nivel'] = 'low'
elif 65.0 <= i <= 82.0:
df['Nivel'] = 'medium'
else:
df['Nivel'] = 'high'
The problem is that all the column is getting the level 'low'
instead of the others when it should..
Am I doing something wrong?