Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
I have :
list_of_DataFrames = [df_1, df_2, df_n, ...]
I would like to write each of these dataframes into a distinct excel file.
I tried :
list_of_DataFrames.to_excel("pathTo/ExcelFile.xlsx")
The list doesn't have a to_excel method. The only way you can do is by looping over the list.
to_excel
for i in range(len(list_of_DataFrames)): list_of_DataFrames[i].to_excel("pathTo/ExcelFile-{}.xlsx".format(i))
Add a comment
for i, df in enumerate([df_1, df_2, df_n, ...]): df.to_excel(f"pathTo/ExcelFile_{i}.xlsx")
Required, but never shown
By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.