私は最近、私のマシンのいずれかにPythonのnumpyのパッケージを更新し、そしてどうやら私は今しばらくa deprecated feature of numpyに頼ってきた:上記のリンクでのコメンターのNumpyのDeprecationWarningが表示されないのはなぜですか?
>>> np.__version__
'1.10.4'
>>> a = np.ones(10, dtype=np.uint16)
>>> a /= 0.5
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: ufunc 'true_divide' output (typecode 'd') could not be coerced to provided output parameter (typecode 'H') according to the casting rule ''same_kind''
一つが指摘:
は、おそらくあなたは永遠に ため、非推奨の警告を見ていないこと。)
を...正しいである、私はしませんでした。
しかし、なぜ?非推奨の警告を見逃してしまったのはどうでしたか?
>>> np.__version__
'1.9.2'
>>> a = np.ones(10, dtype=np.uint16)
>>> a /= 0.5
>>> a
array([2, 2, 2, 2, 2, 2, 2, 2, 2, 2], dtype=uint16)
を...しかしは、この警告をトリガしないでください。
the documentationと一致、この同じコードは、私の以前のnumpyのバージョンでは異なる働いていましたか?私はnumpyが廃止警告をどのように処理するのか誤解していますか? 他の廃止予定の警告が表示されないようにするにはどうすればよいですか?
私のPython環境:
Python 3.5.1 |Anaconda 4.0.0 (64-bit)| (default, Feb 16 2016, 09:49:46) [MSC v.1900 64 bit (AMD64)] on win32
それらはデフォルトで無視されている – wim