日本免费高清视频-国产福利视频导航-黄色在线播放国产-天天操天天操天天操天天操|www.shdianci.com

學無先后,達者為師

網站首頁 編程語言 正文

Python運行出現DeprecationWarning的問題及解決_python

作者:旺?崽 ? 更新時間: 2022-09-04 編程語言

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

原文鏈接:https://zaizai.blog.csdn.net/article/details/107643924

欄目分類
最近更新