Python做聚类分析时报错 AttributeError: ‘NoneType‘ object has no attribute ‘split‘

问题描述

在使用python做聚类分析时,产生错误:
Python做聚类分析时报错 AttributeError: ‘NoneType‘ object has no attribute ‘split‘_第1张图片
错误如下:Python做聚类分析时报错 AttributeError: ‘NoneType‘ object has no attribute ‘split‘_第2张图片
在网上查看相应的文章,因为不是相同情况,所以解决方法均不合适。

处理办法

首先想到是sklearn版本不合适,目前版本是scikit_learn1.1.1,因此下载scikit_learn的1.0.2版本。
Python做聚类分析时报错 AttributeError: ‘NoneType‘ object has no attribute ‘split‘_第3张图片

但重新跑算法时依旧会报错,因此怀疑是 numpy+mkl 的版本问题,故重新下载numpy+mkl 的包。

在里插入图片描述
Python做聚类分析时报错 AttributeError: ‘NoneType‘ object has no attribute ‘split‘_第4张图片

安装完成后,重新跑算法,成功运行。

Python做聚类分析时报错 AttributeError: ‘NoneType‘ object has no attribute ‘split‘_第5张图片

结论:

应该是numpy的包出现问题,需要重新安装numpy+mkl ,相关的包下载链接在此:添加链接描述

你可能感兴趣的:(python,numpy,机器学习)