Suppose I have a data frame df
column A  column B   column C
large     prom2      34
large     prom1      21
large     prom1      12
large     prom2      8
medium    prom2      5
medium    prom1      7
medium    prom1      12
medium    prom2      12
small     prom1      16
small     prom1      14
small     prom2      12
small     prom1      14
I want to make an analysis of variance (ANOVA), therefore I want to prepare my table. column A value is an index, the value in column B is a new column, and C is a value of the new table. Hence the table should be like this:
col_index  col_prom1  col_prom2
   large      21         34
   large      12         8
   medium     7          5
   medium     12         12
   small      16         12  
   small      14         NaN
   small      14         NaN
 
     
    