LaVOZs

The World’s Largest Online Community for Developers

'; Python DataFrame how to replace a tab in an excel spreadsheet - LavOzs.Com

I am trying to replace a tab in an excel spreadsheet with an updated version. The sheet contains many tabs.

The following:

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

Creates a new tab. What I am trying to do is REPLACE the currently existing tab in order to update the data..

Using the above without the mode = 'a' but that replaces the entire file with just the rsi tab.

I'm very much a beginner in coding,

Thank you in advance.

Related