[已解决]AttributeError: module ‘numpy‘ has no attribute ‘float‘

1、问题: 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

2、解决方法[参考]

conda list

降低numpy 版本:

python 复制代码
pip uninstall numpy
pip install numpy==1.23.5
相关推荐
七夜zippoe2 天前
NumPy向量化计算实战:从入门到精通的性能优化指南
python·性能优化·架构·numpy·广播机制·ufunc
one day3214 天前
从numpy-pillow-opencv的基础学习
opencv·numpy·pillow
lrh1228006 天前
Numpy学习
numpy
拾贰_C6 天前
[python | numpy] numpy& matplotib冲突
开发语言·python·numpy
陈晨辰熟稳重8 天前
20260113-np.random.multinomial 与 torch.multinomial
pytorch·python·numpy·采样·multinomial
charlie1145141919 天前
从 0 开始的机器学习——NumPy 线性代数部分
开发语言·人工智能·学习·线性代数·算法·机器学习·numpy
muddjsv13 天前
NumPy 常用工具:统计、排序、缺失值处理
numpy
muddjsv13 天前
NumPy 核心运算:向量化与广播
numpy
muddjsv13 天前
NumPy 实战:从基础到场景化应用
numpy
A尘埃14 天前
Numpy常用方法介绍
numpy