So I've got this dataframe/csv file:
,stock,adj_close
0,GERN,3.59
1,GERN,3.3
2,GERN,3.34
...
4530,CMCSA,35.78
4531,CMCSA,35.46
4532,CMCSA,35.08
...
9060,AAPL,189.63
9061,AAPL,189.25
9062,AAPL,190.31
With a bunch more stocks and datapoints. There's an equal amount of rows per stock, and every row is a day. What I'd like to achieve is that the header row consists of all stock names, and the rows below it to be the value in adj_close. So the result would look like this:
, GERN, CMCSA, AAPL, ............
0, 3.59, 35.78, 189.63 .. .. .. ..
1, 3.3, 35.46, 189.25 .. .. .. ..
2, 3.34, 35.08, 190.31 .. .. .. ..
Is this possible?
I looked into the pivot method and some for loops but couldn't get it to work.