赞
踩
- 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'?
在较新的NumPy版本中(如,NumPy 1.20),np.float已经被弃用并移除了
将dtype=np.float替换为dtype=float或dtype=np.float64
(注意,int类型也同理,需将np.int替换为int或np.int32或np.int64)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。