1
are fine?
How to export or save a table made with pandas.Dataframe in csv or xlsx format in Python?
1
are fine?
How to export or save a table made with pandas.Dataframe in csv or xlsx format in Python?
2
export csv
df = pd.DataFrame({'name': ['Raphael', 'Donatello'],
'mask': ['red', 'purple'],
'weapon': ['sai', 'bo staff']})
csv = df.to_csv(index=False)
export in xlsx
df1 = pd.DataFrame([['a', 'b'], ['c', 'd']],columns=['col 1', 'col 2'])
df1.to_excel("output.xlsx")
1
Example of Pandas.Dataframe documentation:
writer = pd.ExcelWriter('output.xlsx')
df1.to_excel(writer,'Sheet1')
df2.to_excel(writer,'Sheet2')
writer.save()
thank you very much :)
Browser other questions tagged csv
You are not signed in. Login or sign up in order to post.
thank you very much :)
– Daniel Melo