I have an array
[False False False ... True True True]
I want to check if the previous value == current value. In pandas, I can use something like...
np.where(df[col name].shift(1).eq(df[col name]), True, False)
I tried using scipy shift but the output isn't correct so maybe I am using it wrong?
np.where(shift(long_gt_price, 1) == (long_gt_price),"-", "Different")
Just to show you what I mean when I say it produces the incorrect output:The left column is the shift(1) and the right column is the unshifted column so the left column should equal the square diagonal up to it at least thats my understanding / what I want the False / True at 5 down on the left and 4 on the right therefore doesnt make any sense to me.
