Hi I want to change one categorical variable's value to other in the condition like ['value1','value2']
Here is my code:
random_sample['NAME_INCOME_TYPE_ind'] = np.where(random_sample['NAME_INCOME_TYPE'] in ['Maternity leave', 'Student']), 'Other')
I tried adding .any() in different position of this line of code, but it still does not resolve the error.
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().