I want to extract from a dataframe only the first row of each value other than one of the columns (pandas) for example:
df
col_A col_B
0 1 x
1 2 xx
2 3 xx
3 4 y
4 5 y
to
df1
col_A col_B
0 1 x
1 2 xx
2 4 y