def function(df):
if (df['Total'] > 0) & (df['Total'] <= 50000):
df['X'] = (df['Total']*(2/150)) * 0.2
elif (df['Total'] > 50000):
df['X'] = ((50000*(2/150))*0.2) + ((df['Total']-50000)*(2/150)*0.2)
I am trying to run the above code but getting a value error saying
File "<ipython-input-31-f77514d81c6f>", line 1, in <module>
platinumplus(cust_spends)
File "<ipython-input-30-da2fd213761f>", line 2, in platinumplus
if (df['Total'] > 0) & (df['Total'] <= 50000):
File "E:\ProgramData\Anaconda3\lib\site-packages\pandas\core\generic.py",
line 1573, in __nonzero__ .format(self.__class__.__name__))
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().