1
我想讀取Excel文件中的蟒蛇,但我得到的錯誤數據框中AttributeError的: '據幀' 對象有沒有屬性 'ICOL'
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
請檢查:
2)Error
哪個pandas版本? icol被推翻http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.icol.html –
哦! icol已棄用。謝謝@ e.arbitrio!現在我已經使用.iloc [:,i] – anashamidkh