Python 为什么我会得到这个pylint错误:“;发电机&x27;发电机&x27;没有';iloc&x27;成员
在conda环境中使用visualstudio代码python3.6.7,我从Pylint收到一条错误消息:“生成器‘Generator’没有‘iloc’成员 代码在Jupyter笔记本中运行正常。这可能与我使用的conda环境有关吗Python 为什么我会得到这个pylint错误:“;发电机&x27;发电机&x27;没有';iloc&x27;成员,python,pylint,Python,Pylint,在conda环境中使用visualstudio代码python3.6.7,我从Pylint收到一条错误消息:“生成器‘Generator’没有‘iloc’成员 代码在Jupyter笔记本中运行正常。这可能与我使用的conda环境有关吗 engine = create_engine('sqlite:///' + database_filepath) df = pd.read_sql_table('MessageClassification',con=engine) X = df.iloc
engine = create_engine('sqlite:///' + database_filepath)
df = pd.read_sql_table('MessageClassification',con=engine)
X = df.iloc[:,1]
Y = df.iloc[:,4:]
category_names=list(df.columns[4:])
return X,Y,category_names
Pylint在df下面加下划线,并显示以下错误消息:
Generator 'generator' has no 'iloc' member pylint(no-member)
听起来Pylint把df当作生成器是一种混淆。这个问题似乎描述了一些类似的东西: