pandas 0.13 read_excel new format
I'm working with pandas a few time ago. In 0.12 version, I read excel files using pandas.read_excel(filename, sheetname, index_col), the read file was in the next format, with the header in the first row:
Date 2 3 2008-01-26 283.7 8 2008-02-26 323.1 8 2008-03-26 270.7 2 2008-04-26 353.6 2
Now, when I save a dataframe to an excel file, the header format changes, in the first row are the columns names, and in the second row the index name, as show in the next table:
2 3 Date 2008-01-26 283.7 8 2008-02-26 323.1 8 2008-03-26 270.7 2 2008-04-26 353.6 2
Finally, when I read the new excel file format (using excel_read function), it reads the second row as a data row, and not takes it as the name of the index.
2 3 Date NaN NaN 2008-01-26 283.7 8 2008-02-26 323.1 8 2008-03-26 270.7 2 2008-04-26 353.6 2
Is there any new function that allows me to read this new file format, taking account that the first and second rows are the new header?
The DataFrame will be written in a way that tries to mimic the REPL output. One difference from 0.12.0 version is that the index_label will be placed in the second row instead of the ﬁrst. You can get the previous behaviour by setting the merge_cells option in to_excel() to False:
df.to_excel('path_to_file.xlsx', index_label='label', merge_cells=False)
Thus your files will be stored in the same way as in version 0.12.00 and will not have problems with reading.