当前位置:   article > 正文

To silence this warning, use `float` by itself. Doing this will not modify any behavior and is safe._deprecationwarning: `np.float` is a deprecated ali

deprecationwarning: `np.float` is a deprecated alias for the builtin `float`
import numpy as np 
e = np.ones((3,3),np.float)# 3x3的浮点型2维数组,并且初始化所有元素值为1
  • 1
  • 2

D:\projects\Numpy\array.py:25: DeprecationWarning:

np.float is a deprecated alias for the builtin float.

To silence this warning, use float by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.float64 here.
Deprecated in NumPy 1.20;

for more details and guidance:

https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
已经给出解释了 就不看这引导了 妹的!

改成:

import numpy as np 
e = np.ones((3,3),np.float64)# 3x3的浮点型2维数组,并且初始化所有元素值为1
  • 1
  • 2

好了 卧槽了!!!!!!!!

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家自动化/article/detail/541700
推荐阅读
相关标签
  

闽ICP备14008679号