I have dataframe in following format-
Index Stock Open
1 ABC 10
2 ABC 12
: : :
1 PQR 12
2 PQR 23
: : :
1 XYZ 0.5
2 XYZ 0.9
: : :
I would like transform above dataframe using variable(Stock) which classification variable, required format is shown below-
Index ABC PQR XYZ
1 10 12 0.5
2 12 23 0.9
: : : :
Note-there might be multiple variable...
Please tell me how can transform or transpose dataframe in above format.