I would like to add multiple dataframes from a dictionary to one excel file and each dataframe should be written in a sheet. Sheen name is actually the key of the dictionary. The following code
for key in df_dict:
df = df_dict[key]
df.to_excel('data-frames.xlsx', sheet_name=key, index=False)
only writes the last dataframe. So, I only see one sheet. On the other hand the append_df_to_excel()
method which is described here doesn't works. I get the error that there is no such method, although the pandas version is 1.4.2.
...
AttributeError: 'DataFrame' object has no attribute 'append_df_to_excel'
In [2]: import pandas as pd
In [2]: print(pd.__version__)
1.4.2
How can I fix that?