I am using the following code,
if(df.month == 3 or df.month == 4 or df.month == 5):
df.test = 'A'
elif(df.month == 6 or df.month == 7 or df.month == 8):
df.test = 'B'
else:
df.test = 'C'
But while using this, I am getting the following error,
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
Update:
print df.columns
Unnamed: 0 int64
year int64
month int64
day int64
dep_time float64
dep_delay float64
arr_time float64
arr_delay float64
carrier object
tailnum object
flight int64
origin object
dest object
air_time float64
distance int64
hour float64
minute float64
print df.dtypes
dtype: object
Can anybody help me in finding the error here?