1、准备工作
- (1):准备好Python或者Anaconda的pandas库,安装:pip install pandas
- (2):pandas依赖处理Excel的xlrd模块,安装命令:pip install xlrd
- (3):打开代码编辑器jupyter、ipython、pycharm,根据自己习惯和需求选用。
2、准备好excel数据表格
3、使用Pandas读取excel数据
df = pd.read_excel('路径',sheet_name='excel中的哪个表,表名/位置')
- 如果不使用sheet_name='***',默认读取第一张表
import pandas as pd
import xlrd
#读取sheet_name