I have a data frame like this:
col1 col2 col3
A B 4
A B 1
A C 2
P B 2
P D 7
P D 3
I want the minimum value of col3 for each combination of col1 and col2. The output will be like:
Col1 Col2 Col3
A B 1
A C 2
P B 2
P D 3
I have tried the code
df.groupby(['Col3']).min()
But It's not giving expected result. How to do this in efficient way ?