Python 获取与目标变量相关的功能列表
我正在尝试获取大于0.15的数据集功能列表 它的代码让我这样做,但我有一个系列熊猫,我不能检索列表中的列名的结果 在我的数据集中删除它们之后。 我感谢你的帮助Python 获取与目标变量相关的功能列表,python,pandas,correlation,Python,Pandas,Correlation,我正在尝试获取大于0.15的数据集功能列表 它的代码让我这样做,但我有一个系列熊猫,我不能检索列表中的列名的结果 在我的数据集中删除它们之后。 我感谢你的帮助 # Remove highly correlated features cor = features_binario.corr() #Correlation with output variable cor_target = abs(cor["G3"]) #Selecting highly correlated features rel
# Remove highly correlated features
cor = features_binario.corr()
#Correlation with output variable
cor_target = abs(cor["G3"])
#Selecting highly correlated features
relevant_features = cor_target[cor_target>0.15]
first_column = relevant_features.iloc[:,0]
first_column
我得到这个错误,IndexingError:索引器太多了
Var: relevant_features
school_GP 0.177564
school_MS 0.177564
higher_no 0.251587
higher_yes 0.251587
course_math 0.168394
course_por 0.168394
age 0.153819
Medu 0.184047
Fedu 0.183627
failures 0.390165
G1 0.701693
G2 0.717439
G3 1.000000
Name: G3, dtype: float64
它是
系列
,因此没有列
对于按条件列出的所有值,请使用:
relevant_features = cor_target.index[cor_target>0.15]
什么是
打印(相关功能.info())
?AttributeError:“Series”对象没有属性“info”我得到了0.177563877163480885它是值它的结束我得到了“school\u GP”@Fernando-预期输出是什么?