0

In a DataFrame with the column 'index' of integers, I'd like to create a boolean column, which will contain True, if 'index' value of each row minus one contains in previous N rows under same column 'index'.

Any help will be much appreciated!

I checked this post: Pandas Check last N Rows for values, new column based on results

But my problem is different.

0 Answers0