赞
踩
使用 pandas 读取 excel 文件的指定列,可以使用 pd.read_excel() 函数,并通过 usecols 参数指定要读取的列。例如:
pd.read_excel()
usecols
import pandas as pd df = pd.read_excel("file.xlsx", usecols=[0, 2, 4])登录后复制
这样,只会读取文件中的第1,3,5列。