So I have these 4 lines of code, I've been trying for hours to figure out how to get this to work. A caveat is that I cannot use a for loop to fix this:
if(np.logical_and((signals['signal'] == 0),(signals['rsip']<=20))):
signals['signal'] = 1.0
if((signals['signal'] == 1.0) & (signals['rsip']>=80)):
signals['signal'] = 0.0
I keep running into the error pointed at the first line:
The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
And I'm not sure what's going wrong... As you can see I even tried using numpy logicals to no avail.