[已解决]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
相关推荐
敲代码不忘补水1 天前
Python Matplotlib 数据可视化全面解析:选择它的七大理由与入门简介
开发语言·python·信息可视化·numpy·pandas·matplotlib
取个名字真难呐3 天前
2、PyTorch张量的运算API(上)
pytorch·python·numpy
敲代码不忘补水3 天前
pandas 机器学习数据预处理:从缺失值到特征切分的全面解析
人工智能·后端·python·机器学习·numpy·pandas·matplotlib
小青头8 天前
numpy学习笔记
笔记·学习·numpy
取个名字真难呐8 天前
矩阵乘法实现获取第i行,第j列值,矩阵大小不变
python·线性代数·矩阵·numpy
小锋学长生活大爆炸9 天前
【教程】Cupy、Numpy、Torch互相转换
pytorch·numpy·cupy
鱼灯几许10 天前
Python爬虫
爬虫·python·numpy
爱折腾的小码农11 天前
记一次宝塔centos出现Failed to start crond.service: Unit crond.service not found.解决
python·centos·numpy
正义的彬彬侠13 天前
XGBoost算法Python代码实现
python·决策树·机器学习·numpy·集成学习·boosting·xgboost
竹笋常青15 天前
《流星落凡尘》
django·numpy