I have the following pandas dataframe:
    time  mes   mech
0   1     50    A
1   2     15    A
2   3     16    A
3   1     17    B
4   2     49    B
5   3     62    B
I would like to aggregate it by time and then have the renamed columns for each mech, like so:
    time  mes_A mes_B
0   1     50    17
1   2     15    49
2   3     16    62
what's the best way to do this?
 
     
    