Hi everybody I am new at this forum, teaching technology since 2006 and before programming in diferent companies. I came from visual basic and now I am diving into python. I have found the next problem when trying to use numpy where method.
f"Cannot perform '{op.__name__}' with a dtyped [{x.dtype}] array "
TypeError: Cannot perform 'ror_' with a dtyped [float64] array and scalar of type [bool]
The code is this one
df['Value']=np.where((df['ValA']>0.01) & (df['ValB']>df['ValC']) & (df['ValB'].shift(1) > 0.8) & (df['ValB'] < 0.8) & (df['ValD'] > 0.02 | df['ValD'].shift(1) > 0.02 | df['ValD'].shift(2)> 0.02), 1, 0)
Everything was working fine untill I used =>
(df['ValD'] > 0.02 | df['ValD'].shift(1) > 0.02 | df['ValD'].shift(2)> 0.02)
as a part of the operator
Thanks in advance!!