1. Home
  2. Docs
  3. Python-DataScience
  4. Data Manipulate with Pandas
  5. Interact with Excel

Interact with Excel

Use Python to read and write Excel files

Read Excel

book = pd.ExcelFile('./数据绘图.xlsx')

sheet = book.parse(sheet_name='结果展示',usecols=np.arange(0,4),skiprows=np.arange(0,30),index_col=0)

Write Excel

wtr = pd.ExcelWriter(path=YOUR_FILE_DIR,engine='openpyxl',mode='a')
wtr = pd.ExcelWriter(path=f,engine='openpyxl',mode='a')
sheet2.to_excel(excel_writer=wtr, sheet_name='结果展示', startrow=40, startcol=8)
wtr.save()
wtr.close()
Was this article helpful to you? Yes No

How can we help?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.