问题描述:
DeprecationWarning: `np.int` is a deprecated alias for the builtin `int`. To silence this warning, use `int` by itself. Doing this will not modify any behavior and is safe.
原因 由于要复现比较早的代码,所以numpy的版本比较低,我用的是1.23.5的版本,但其他的包源码有涉及低版本numpy的使用方法,比如说早期的np.int使用 现在改为 int了,所以要重新指定。
!!!提醒 务必确认好自己已经安装了低版本的numpy包
解决方案有两种方式
第一种
import numpy as np
np.int = int
效果如下:
第二种 直接加上np.int=int