Python运行出现DeprecationWarning的问题及解决
Python运行出现DeprecationWarning
今天运行 py 时出现下面的问题:
DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3,and in 3.9 it will stop working
是这个语句出现的问题:
from collections import Iterable
好像是 py 版本更新以后包发生了变化,只需要改一下包名就行:
collections->collections.abc
Python版本问题出现DeprecationWarning
sklearn.cross_validation.cross_val_score()
例如:
from sklearn import cross_validation
D:\Anaconda3\lib\site-packages\sklearn\cross_validation.py:41: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions are moved. Also note that the interface of the new CV iterators are different from that of this module. This module will be removed in 0.20. "This module will be removed in 0.20.", DeprecationWarning)
改为
from sklearn.model_selection import cross_val_score
以上为个人经验,希望能给大家一个参考,也希望大家多多支持脚本之家。
相关文章
Python可变参数*args和**kwargs用法实例小结
这篇文章主要介绍了Python可变参数*args和**kwargs用法,结合实例形式总结分析了Python中可变参数*args和**kwargs的功能、区别与具体使用技巧,需要的朋友可以参考下2018-04-04
使用python把xmind转换成excel测试用例的实现代码
这篇文章主要介绍了使用python把xmind转换成excel测试用例的实现代码,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下2020-10-10
python GUI库图形界面开发之PyQt5 MDI(多文档窗口)QMidArea详细使用方法与实例
这篇文章主要介绍了python GUI库图形界面开发之PyQt5 MDI(多文档窗口)QMidArea详细使用方法与实例,需要的朋友可以参考下2020-03-03


最新评论