I have dataframe that is shown below,
type label
0 0 0
1 0 0
2 0 0
3 0 0
4 2 1
5 2 1
6 2 1
7 2 1
8 2 1
9 2 1
10 0 0
11 0 0
12 0 0
13 0 0
14 0 0
15 0 0
16 0 0
17 0 0
18 0 0
19 0 0
(Need some magic to be done)
The change should be made in type column such that, in a row if label is 0 and type is 0 then next row of type should be assigned 2.
Full dataframe should look like this:
type label
0 0 0
1 2 0
2 2 0
3 0 0
4 2 1
5 2 1
6 2 1
7 2 1
8 2 1
9 2 1
10 0 0
11 2 0
12 2 0
13 2 0
14 2 0
15 2 0
16 2 0
17 2 0
18 2 0
19 2 0