Home>Article>Backend Development> How to import data in excel in python3.6

How to import data in excel in python3.6

(*-*)浩
(*-*)浩 Original
2019-06-29 10:16:31 12679browse

Because the company cannot connect to the database and import tables directly, it often needs to import excel. Therefore, using Python3.6 can only import excel tables through modules.

How to import data in excel in python3.6

Import package xlrd module (first determine whether python has the xlrd module installed)(recommended learning:Python video tutorial)

How to import data in excel in python3.6

Process data (get the current table and select table 1, or any name you change)

How to import data in excel in python3.6

Processing data (reading data from the table and getting the rows and columns of the data in the table)

How to import data in excel in python3.6

Output data (the print function is relatively simple, and can also be output in a loop, because excel data tables are all two-dimensional arrays after all)

How to import data in excel in python3.6

How to import data in excel in python3.6

Note:

Be sure to install the xlrd module.

The data table must be determined before obtaining the data

For more Python-related technical articles, please visit thePython Tutorialcolumn to learn!

The above is the detailed content of How to import data in excel in python3.6. 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