I have this line of code:
df['volume_up'] = np.where(df['trade_direction'] == True, df['volume'], float('nan'))
and I get this warning:
but if I change the statement to
df['trade_direction'] is True
it will not work anymore.
Why am I getting this warning? or am I implementing the change the wrong way?