How to compare different rows of the same DataFrame in Python
So, a python equivalent would look something like:  col2[i] = col1[i] in col1[i+1:i+N+1] in a loop?
I want to find a fast method to compare every DataFrame row with the next N without using a "for cycle" (due to time computational problems).
Here an example. My dataframe df is:
index | col 1 | col 2 
0         c           
1         a           
2         b           
3         b           
4         c           
...                   
I want to insert True/False in col 2 (i-th rows) if, in one of the next N, the col 1 value is the same as the one in the i-th row.
Here the results for N=3.
index | col 1 | col 2 
0         c    False  
1         a    False  
2         b    True   
3         b    False  
4         c    True   
5         a    ...    
6         c           
...                   
NB I've tried to create new columns with shift and compare with .loc, but with big N I still have computational problems