AttributeError: module 'pandas' has no attribute 'Factor'

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Albert201605/article/details/82316879

在新版本的pandas,Factor 换成了 Categorical

pd.Factor(iris.target, iris.target_names)

替换为

pd.Categorical.from_codes(iris.target, iris.target_names)

猜你喜欢

转载自blog.csdn.net/Albert201605/article/details/82316879