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.
Import package xlrd module (first determine whether python has the xlrd module installed) (recommended learning: Python video tutorial)
Process data (get the current table and select table 1, or any name you change)
Processing data (reading data from the table and getting the rows and columns of the data in the table)
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)
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 the Python Tutorial column 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!