I'm trying to turn a float64 value into a binary variable for a predictive model. With it, I was going to do if the price is >= 152.00 then to assign it a 1 else a 0. But I'm getting this error: Getting error The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all()
I'm confused because everything that I read says to fix to issue, I should use the bitwise operators instead of AND and OR. But I'm not using those. Any ideas what I could do to fix it?
if df_full_train['price'] >= 152.00:
df_full_train['above_average'] =1
else:
df_full_train['above_average'] =0