I have a CSV file format like this:
filename  value  class
file1     55     mango
file1     62     orange
file1     74     apple
file2     75     mango
file2     42     orange
file3     89     apple
file4     54     orange
file4     35     apple
I want to transform this on the basis of its class values, like this:
filename   mango  apple  orange
file1      55     74     62
file2      75     0      42
file3      0      89     0
file4      0      54     35
Please, help me with this.
I have tried the groupby method but that didn't work.
 
     
     
    