My terminology is horrible so this one deserves some explanation. Imagine that I have a DataFrame like this (which I call the "long" table):
time stock price
---------------------------
13:03:00 AAPL 100.00
13:03:00 SPY 200.00
13:03:01 AAPL 100.01
13:03:02 SPY 200.01
13:03:03 SPY 200.02
.
.
.
and I wanted to convert it to a DataFrame like this (which I call the "wide and sparse" table):
time AAPL SPY
---------------------------
13:03:00 100.00 200.00
13:03:01 100.01 Nan
13:03:02 Nan 200.01
13:03:03 Nan 200.02
So obviously this is quite a transformation. Is there a built-in function that does this? It seems like it might be a pretty common thing to want to do.
Thanks!