I need to convert a Pandas dataframe with multiple rows into one row.
Having the following dataframe.
X Y V
A 0 0.1
A 1 0.2
B 0 0.3
B 1 0.4
I'd like to convert the dataframe to the following format. V_0 means "Value where Y=0". How to achieve this transformation?
X V_0 V_1
A 0.1 0.2
B 0.3 0.4