Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12111

Pandas modify the original excel

$
0
0

I want to replace a value into an excel and then save it.Using the following code I see that pandas is changing the format of the original excel.

writer = pd.ExcelWriter(str(Path.cwd())+'\file.xlsx', engine='openpyxl')new_df.to_excel(writer, sheet_name='test')writer.close()

Basically I see that, if for instance in the original excel file, after the save everything is lost. Is there a way to save the existing "layout" of the original excel?

Original excelafter the writer


Viewing all articles
Browse latest Browse all 12111

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>