Issue
I get this error while i want to keep my dataframe in excel file which name pandas_simple.xlsx
Below is my error:
This is my code:
import pandas as pd
df = pd.DataFrame({'Car': [101, 20, 350, 20, 15, 320, 454]})
writer = pd.ExcelWriter('pandas_simple.xlsx')
df.to_excel(writer, sheet_name='Sheet1')
writer.save()
writer.close()
Anyone can share some idea to me here?
Solution
You try to write to a folder where you need administration rights. Change:
writer = pd.ExcelWriter("pandas_simple.xlsx")
to:
writer = pd.ExcelWriter("C:\\...\\pandas_simple.xlsx")
with the full path and you will not have a problem.
Answered By - Michail N
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.