I have the below data frame
lst = [['A',1],['B',0],['C',1],['D',0],['E',1],['F',1],['G',1]]
df = pd.DataFrame(lst,columns = ['name','val'])
Looks like this
name val
0 A 1
1 B 0
2 C 1
3 D 0
4 E 1
5 F 1
6 G 1
I am trying to get rows where val is 1 but they should be bottom continuous rows.
Desired output
name val
4 E 1
5 F 1
6 G 1
I am doing, which will give all val with 1.
df[df.val == 1]