0

I would like some help with the following problem.

enter image description here

I would like to check if the bottom end for 20/01/2015 (blue circle) is either greater than the close of 21/01/2015 (red circle) I can check this condition for the same day but am having difficulty to check it for the next day.

Ideally I would like to run a loop that will check this condition for the entire dataframe. Any help will be greatly appreciated.

SmithyB
  • 7
  • 2

1 Answers1

0

First dont loop in pandas.

If need compare with next days rows use Series.gt with Series.shift:

df['test'] = df['Bottom End'].gt(df['Close'].shift(-1))
jezrael
  • 822,522
  • 95
  • 1,334
  • 1,252