I have a code like:
def sample_func(new_df):
if ( new_df['name'] == 'Tom'):
return "Yes"
elif( new_df['name'].isin(['Harry', 'Jerry', 'Savi', 'Aavi'])):
return "Common Name"
else:
return None
I am getting error as:
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
How to fix such errors?