python中导入 train_test_split提示错误的解决
如下所示:

原因:
在python3.6中sklearn已弃用train_test_split,导致导入报错
解决方式,用model_selection模块导入:
from sklearn.model_selection import train_test_split

经测试,在python2中也是使用该方式导入train_test_split模块
补充知识:from sklearn.model_selection import train_test_split找不到模块
解决方案:
pip uninstall numpy
pip install numpy==1.16(或pip install numpy==1.14.5)
如果提示权限不够,‘[WinError 5]拒绝访问',则需打开管理员权限

以上这篇python中导入 train_test_split提示错误的解决就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持脚本之家。
相关文章
PyQt5 QTreeWidget 树形结构递归遍历当前所有节点的实现
Qt中实现树形结构可以使用QTreeWidget类,也可以使用QTreeView类,本文主要介绍了PyQt5 QTreeWidget 树形结构递归遍历当前所有节点的实现,文中通过示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下2021-11-11


最新评论