I am grouping my dataset by column A and then would like to take the minimum value in column B and the corresponding value in column C.
data = pd.DataFrame({\'A\
I feel like you're overthinking this. Just use groupby and idxmin:
groupby
idxmin
df.loc[df.groupby('A').B.idxmin()] A B C 2 1 2 10 4 2 4 4
df.loc[df.groupby('A').B.idxmin()].reset_index(drop=True) A B C 0 1 2 10 1 2 4 4