Please help, I don't know why this error is happening. I have used this code previously with no issues. I hope it's not something stupid. Always appreciate the help.
Versions:
python 3.6
pd 0.23.0
xlsxwriter 1.0.4
writer = pd.ExcelWriter('Output.xlsx', engine='xlsxwriter')
workbook = writer.book
worksheet = writer.sheets['Sheet1']
Output:
Traceback (most recent call last):
File "/opt/eclipse/dropins/plugins/org.python.pydev.core_7.2.0.201903251948/pysrc/_pydevd_bundle/pydevd_exec2.py", line 3, in Exec
exec(exp, global_vars, local_vars)
File "<console>", line 1, in <module>
KeyError: 'Sheet1'
Sheet1
to something else?