I have a Dataframe and I want to get the previous data as an example, how can I do this?
If the previous row of A is B, get the value of B
Dataframe
df = pd.DataFrame({'Status':['A','A','A','A','A','B','A','A','A','A']})
print(df)
Status
0 A
1 A
2 A
3 A
4 A
5 B <----- get the value
6 A
7 A
8 A
9 A