(已解决)DeprecationWarning: `np.float` is a deprecated alias for the builtin `float`.

2023-11-17

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

看了一个博主解释了一下:

弃用警告:np.float是内置float的不推荐别名。要去除这个Warning,需要单独使用float

人话:np.float是将要被弃用的,可以用float替代。

 改为

 

 

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

(已解决)DeprecationWarning: `np.float` is a deprecated alias for the builtin `float`. 的相关文章

随机推荐