import pandas as pd
data={'col1':[1,3,3,1,2,3,2,2]}
df=pd.DataFrame(data,columns=['col1'])
print df
col1
0 1
1 3
2 3
3 1
4 2
5 3
6 2
7 2
I have the following Pandas DataFrame and I want to create another column that compares the previous row of col1 to see if the value of the row is greater than that of the previous row. It should come out like the following:
col1 match
0 1 False
1 3 False
2 3 True
3 1 False
4 2 False
5 3 True
6 2 False
7 2 True
Thank you.