I have a dataframe with one index as datetime like below and I am looking to add a first columns index (see "target" below) where any dates are crossed to it (First_column).
First_column = ['s0000', 's0001', 's0002', 's0003', 's0004', ...]
Has someone any idea on how to proceed ?
Thank you very much. Alexis
My dataframe :
<class 'pandas.core.frame.DataFrame'>
DatetimeIndex: 17544 entries, 2015-01-01 00:00:00 to 2016-12-31 23:00:00
Data columns (total 12 columns):
Target:
<class 'pandas.core.frame.DataFrame'>
MultiIndex: 996000 entries, (s0000, 2015-01-01 00:00:00) to (s0999, 2012-12-31 00:00:00)
Data columns (total 8 columns):
SCENARIO DATE
s0000 2015-02-28
2015-03-03
2015-03-04
2015-03-05
2015-03-06
2015-03-07
2015-03-10
2015-03-11
2015-03-12
2015-03-13
s0001 2015-02-28
2015-03-03
2015-03-04
2015-03-05
2015-03-06
2015-03-07
2015-03-10
2015-03-11
2015-03-12
2015-03-13
s0002 2015-02-28
2015-03-03
2015-03-04
2015-03-05
2015-03-06
2015-03-07
2015-03-10
2015-03-11
2015-03-12
2015-03-13
s0003 ...