Pandas 中的相关性 - AttributeError: 'float' 对象没有属性 'shape'

问题描述

我试图读入一个文件,子集 2 行并找到它们之间的相关性。

dfCorrelation=pd.read_csv(filename)
df1 = dfCorrelation.loc[1] #to subset the first row
df2 = dfCorrelation.loc[2] #to subset the second row
print(df1.corr(df2))

这是我的代码。它错误地说 AttributeError: 'float' object has no attribute 'shape'

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)