I've got several different futures price time series combined into one data frame using concat. For example, soybeans and corn futures contracts for a number of different years.
I would like to compare the prices of the varying contracts graphically on the same time basis, in this case Nov 1 through July 1, disregarding the year. To do that, I used reset_index() to combine them together.
Only problem is when I graph them, I'd like to have an x-axis that is a bit more intuitive than just a 0 to 160 numerical index interval. Ideally, I would like to have the labels Nov 1 through Jul 1 monthly and omit the year.
This of course is fairly easy to do in excel, but Iād like to be able to do it in Python as well.
dfc14 = quandl.get('CME/CZ2014.6', start_date='2013-11-01', end_date='2014-07-\ 01', authtoken=api_key)
dfs14 = quandl.get('CME/SX2014.6', start_date='2013-11-01', end_date='2014-07-01', authtoken=api_key)
dfr14 = dfs14.div(dfc14)
dfr14 = dfr14.rename(columns={'Settle':'2014'})
dfr14 = dfr14.reset_index()
# ...
com_df = pd.concat([dfr17, dfr16, dfr14],)