1

I am trying to over-write specific tabs in an excel file (leaving the rest intact). I am trying to copy synatx from the documentation but I get an error.

with ExcelWriter('C:\\Users\Tiki\Desktop\work\VFT Technicals\Production2\dashboard_v2.xlsx') as writer: 
    output_rsi.to_excel(writer,sheet_name='rsi')

This returns the error:

NameError: name 'ExcelWriter' is not defined

Hoping for some advice, I am very much a beginner at coding.

Thanks in advance.

1 Answer 1

4

your script is not recognize 'ExcelWriter' keyword. it is part of python's pandas library. you should write below things to work it out.

please try :

import pandas as pd and use

with pd.ExcelWriter('C:\\Users\Tiki\Desktop\work\VFT Technicals\Production2\dashboard_v2.xlsx') as writer: 
    output_rsi.to_excel(writer,sheet_name='rsi')

or import pandas.ExcelWriter as ExcelWriter

Sign up to request clarification or add additional context in comments.

1 Comment

Dead on! It was a typo I was making. Thank you very much.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.