I have the following DataFrame:
>>> BA_df
'BID_price' 'ASK_price'
2017-06-01-09:30 100.00 101.50
2017-06-01-09:35 102.00 101.80
2017-06-01-09:40 101.65 101.82
What I would like to do is make both rows equal to zero if the BID_price
is greater than, or equal to, the ASK_price
. Otherwise, leave everything as it is. I checked out this question, which uses numpy.select(), but I'm not sure how to implement it in my case.