I have a dataframe like below:
A B
254 1.2
254 0.9
253 2
253 1.8
253 1.9
252 1.5
251 1.2
251 1.7
251 1.8
251 1.6
250 0.9
250 0.95
250 1.1
250 1.11
250 1
I need this dataframe to be transformed as:
254 253 252 251 250
1.2 2 1.5 1.2 0.9
0.9 1.8 1.7 0.95
1.9 1.8 1.1
1.6 1.11
1
Where values 254, 253 etc are now the column names.
I have tried dataframe.T, dataframe.pivot and dataframe.melt techniques but I do not get the desired dataframe as shown above.
Please advise how can this be done.