I'm trying to write a dataframe (from zipline pickle) to excel, but so far it's not working as usual (for dataframes). Suggestions would be greatly appreciated!
writer = pd.ExcelWriter('output.xlsx')
backtest_df.to_excel(writer,'sheet1')
writer.save()
With the following error:
KeyError: class 'pandas._libs.tslib.Timestamp'
Try downgrading your
openpyxl
package to 2.5.3 version.I had the same error using 2.5.6 version of
openpyxl
and trying to save a pandasDataFrame
with aDatetimeIndex
. Downgrading it to 2.5.3 solved it for me.