赞
踩
因为今天更新了Numpy的最新版导致了之前的用法失效
故
需要用上最新用法
本来我的返回值是这样
return np.array(df).astype(np.float)
DeprecationWarning:
np.float
is a deprecated alias for the builtin
float
. To silence this warning, usefloat
by itself. Doing this
will not modify any behavior and is safe. If you specifically wanted
the numpy scalar type, usenp.float64
here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
return np.array(df).astype(np.float)
貌似是因为版本的问题
然后
我们就去官网康康
从图片上看的话
修改为下即可:
return np.array(df, dtype=float)
或者
return np.array(df).astype(np.float64)
这样就不会报错了~
"
夏天是什么
我们并不知道
只知道一种潮湿
在身体里面
不来也不去
宛如永恒
"
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。