Can Pandas read and modify a single Excel file worksheet (tab) without modifying the rest of the file?

前端 未结 6 939
清歌不尽
清歌不尽 2020-12-08 21:19

Many spreadsheets have formulas and formatting that Python tools for reading and writing Excel files cannot faithfully reproduce. That means that any file I want to create p

6条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-08 22:09

    if you're talking about 'sheets' as 'tabs', then it is possible to modify just one of the tabs by accessing the particular one using the parse(sheet_name) function.

    an example is here: Reading an Excel file in python using pandas

    to write back to excel, (while controlling the sheets) use the to_excel function, here: http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.to_excel.html

提交回复
热议问题