The cboe VXV data had a missing column name 'Date'
vxvUrl = 'http://www.cboe.com/publish/scheduledtask/mktdata/datahouse/vxvdailyprices.csv'
fetch_csv(vxvUrl, symbol='VXV', skiprows=2,date_column='Date',pre_func = addFieldsVXV)
def addFieldsVXV(df):
df.rename(columns={'Unnamed: 0': 'Date'}, inplace=True)
#df = reformat_quandl(df,'CLOSE')
print df.tail()
print df.index
return df
The codes have the following result.
Date OPEN HIGH LOW CLOSE
2264 11/30/2016 15.66 16.11 15.40 16.10
2265 12/01/2016 16.00 16.99 15.99 16.67
2266 12/02/2016 16.77 16.87 16.27 16.78
2267 12/05/2016 16.28 16.38 15.77 15.77
2268 12/06/2016 15.57 15.78 15.38 15.48
1-The index int numbers seem annoying ! Is it possible to still use the Date column as the index of the dataframe ?
2-With a missing Date name, why the fetch_csv function still need the
date_column='Date'
The codes really confuses me. Help plz