The data variable is a percentage i calculated to rank each input. when i run this code it is returning with this error. "ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all()." Please let me know how to fix this or possible helpers.
Thanks!!
def create_column(data):
if data <= 1.1175:
grouping = 'not popular'
elif data > 1.1176 and data < 2.235:
grouping = 'Mildly not popular'
elif data > 2.236 and data < 3.3525:
grouping = 'Mild Popularity'
elif data >=4.47:
grouping = 'popular'
else:
grouping = 'Neutral'
return grouping
data = df1['score']
create_column((data))