and below is the code when I check the px index column:
px.index
DatetimeIndex([‘2007-01-21’, ‘2007-01-28’, ‘2007-02-04’, ‘2007-02-11’,
‘2007-02-18’, ‘2007-02-25’, ‘2007-03-04’, ‘2007-03-11’,
‘2007-03-18’, ‘2007-03-25’,
…
‘2016-10-30’, ‘2016-11-06’, ‘2016-11-13’, ‘2016-11-20’,
‘2016-11-27’, ‘2016-12-04’, ‘2016-12-11’, ‘2016-12-18’,
‘2016-12-25’, ‘2017-01-01’],
dtype=‘datetime64[ns]’, name=‘date’, length=520, freq=‘W-SUN’)
I can’t seem to find out what’s causing the error…if I add an index column before the date column then there are unexpected column numbers of 5 instead of 4.
Below is the info of px for reference:
px.info()
<class ‘pandas.core.frame.DataFrame’>
DatetimeIndex: 520 entries, 2007-01-21 to 2017-01-01
Freq: W-SUN
Data columns (total 4 columns):Column Non-Null Count Dtype
0 AAPL.US Equity 520 non-null int64
1 AMZN.US Equity 520 non-null int64
2 GOOG.US Equity 520 non-null int64
3 FB.US Equity 520 non-null int64
dtypes: int64(4)
memory usage: 20.3 KB
Thanks for all the help!