-2

I have below dataframe with unique combination of level and match,

Input Data:

level  match params  value
    0      0      m  value1
    0      1      p  value2
    1      0      m  value3
    1      1      p  value4

enter image description here

want to convert into below format, so that I got values in one line for level and match.

m         p
value1    value2
value3    value4 
Kamlesh
  • 511
  • 1
  • 7
  • 18

1 Answers1

0

Pandas - How to make new columns from unique values and group by unique value?

Found solution :
df_out = pd.pivot(df1, index='level', columns="params", values="value").reset_index()

Kamlesh
  • 511
  • 1
  • 7
  • 18