I'm looking to pivot a dataframe but keep two columns as identifiers (each row of the dataframe will have unique values for each identifier). I can't work out how to do this through the pd.pivot function The original dataframe is:
name code colour price
0 B1 200 red 54
1 B2 201 blue 33
2 B3 202 green 45
and I want to see
name code red blue green
B1 200 54
B2 201 33
B3 202 45