赞
踩
AttributeError: module 'numpy' has no attribute 'float'.
`np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, 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.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations. Did you mean: 'cfloat'?
这是pycharm给的报错原因,笔者查了相关资料,发现都太麻烦了,仔细看错误,会发现系统推荐我们使用np.float64 这种用法,所以我们先定位到np.float相关代码处,如下图所示:
重新运行demo文件,成功
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。