【发布时间】:2018-06-26 09:00:34
【问题描述】:
我有一个(1460, 76) 大小的数据集。它目前在 pandas Dataframe 中,它有各种数据类型:int, float, object。我正在尝试在此数据帧上运行 VIF 函数以获取我的变量的相关性,但是它抛出了这个错误:
TypeError: '>=' not supported between instances of 'str' and 'int'
VIF 代码:
vif = [variance_inflation_factor(df.values, i) for i in range(df.shape[1])]
print(vif)
可能是什么原因,是因为我的数据中有字符串吗?
【问题讨论】:
标签: python pandas numpy statistics statsmodels