Dataframe AttributeError:'DataFrame'对象没有属性'icol'

我想阅读Excel中的Excel文件,但我得到错误

Attribute error: 'Dataframe' object has no attribute 'icol' 

码:

  import pandas as pd import numpy as np file = pd.ExcelFile("reports.xlsx") sheet = pd.read_excel("reports.xlsx",sheetname=0) item = sheet.icol(0) amount = sheet.icol(1) 

其他细节:Python 3.6.1和Windows 10。

请检查:

1) 示例Excel文件

2) 错误

请参阅http://pandas.pydata.org/pandas-docs/version/0.19.2/generated/pandas.DataFrame.icol.html ,不推荐使用icol方法,而应使用iloc

编辑:我看到你已经发现的评论。