我想在教学时忽略所有包装中的警告,但是scikit-learn似乎可以解决使用warnings包来控制它的问题.例如:
with warnings.catch_warnings():
warnings.simplefilter("ignore")
from sklearn import preprocessing
/usr/local/lib/python3.5/site-packages/sklearn/utils/fixes.py:66: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
if 'order' in inspect.getargspec(np.copy)[0]:
/usr/local/lib/python3.5/site-packages/sklearn/utils/fixes.py:358: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
if 'exist_ok' in inspect.getargspec(os.makedirs).args:
Run Code Online (Sandbox Code Playgroud)
我是否错误地使用了这个模块,或者是否正在做一些不应该做的事情?