I would like to create a calculated column which is as shown in line 1 but is 0 otherwise
openOptions['Cash Reserve'] = (openOptions['Quantity'] * openOptions['Strike'] * 100)
openOptions['Cash Reserve'] = 0 if (openOptions['OptionType'] == 'C') else openOptions['Cash Reserve']
I get an error:
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
How should I resolve this?