Home >Backend Development >Python Tutorial >How to process excel data in python

How to process excel data in python

尚
Original
2020-04-24 15:47:1210822browse

How to process excel data in python

In python language, you can use xlrd and xlwt two libraries to operate excel.

How to process Excel in python language:

In the python project, create a new python file and import xlrd and xlwt in sequence.

How to process excel data in python

Then call the open_workbook() method to open an excel file

How to process excel data in python

Call the sheet_by_name() method to read the file The sheet page

How to process excel data in python

If an s is added at the end, sheet_names means to get all the sheet pages in excel

How to process excel data in python

Using the sheets() method to add a serial number, you can get a sheet page object

How to process excel data in python

If you want to get the total number of records in a sheet page in excel, use nrows

How to process excel data in python

Pass in two values ​​in cell(), one row and one column, and then value gets the value of the corresponding cell

How to process excel data in python

Recommended: python video tutorial

The above is the detailed content of How to process excel data in python. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn