I have a dataframe with multiindexing and a lot of rows. The indices are 'item' and 'TimeStamp'
Each of the items have a different number of elements as some of the values were NaN and they were erased from the dataset. I would like to regenerate the lost rows and obtain a new dataframe described below.
Ideally I would like to:
- create a new dataframe with the full DateTime index with a step of 10 minutes. It's size would be (full DateTimeIndex x number of items)
- each column would contain data for a separate item and the rows where the data is missing would be NaN. The column names would refer to item numbers ('I01', 'I02'... etc.)
This way I would remove the multiindexing and be able to perform quicker operations on a 2D df.
The df I have is as follows:
value
item TimeStamp
I01 2011-09-20 00:00:00 -11.280400
2011-09-20 00:10:00 -11.945430
2011-09-20 00:20:00 -11.962580
2011-09-20 00:30:00 -12.074700
2011-09-20 00:40:00 -11.923750
...
I07 2014-05-31 23:20:00 985.375427
2014-05-31 23:30:00 951.776611
2014-05-31 23:40:00 822.368286
2014-05-15 23:50:00 879.974792
2014-06-01 00:00:00 587.804321
[nevermind how many rows x 1 columns]
I will be really grateful for any help with this. I am quite new to Python.