There’s something wrong with numpy
Because the latest version of numpy is updated today, the previous usage is invalid
So You need to use the latest usage
Originally, my return value is like this
return np.array(df).astype(np.float)
Error:
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)
It seems to be because of the version of the problem
If you look at the picture
Modify to the following can be.
return np.array(df, dtype=float)
perhaps
return np.array(df).astype(np.float64)
So you won’t make a mistake
Read More:
- [Solved] Pytorch Tensor to numpy error: RuntimeError: Can‘t call numpy() on Tensor that requires grad.报错
- Python error collection: NameError: name ‘numpy’ is not defined
- [Solved] RuntimeError: Numpy is not available (Associated Torch or Tensorflow)
- numpy.AxisError: axis 1 is out of bounds for array of dimension 1
- To silence this warning, use `float` by itself. Doing this will not modify any behavior and is safe.
- Python3 Error: Cannot uninstall ‘numpy’. It is a distutils installed project and thus we cannot accurate
- How to Solve M1 chip import numpy Error
- can‘t multiply sequence by non-int of type ‘numpy.float64‘
- Python: RNN principle realized by numpy
- numpy.concatenate() 253rd; 38169Keyerror: 0 [How to Solve]
- [Solved] RuntimeError : PyTorch was compiled without NumPy support
- [Solved] Original error was: No module named ‘numpy.core._multiarray_umath‘
- Python ImportError: numpy.core.multiarray failed to import
- Import CV2 & Numpy report red Warning and Error [How to Solve]
- [Solved] mnn Import Error: initMNN: init numpy failed
- [Solved] Ubuntu using blender script error: Numpy cannot be found
- VScode import numpy Error: DLL load failed [How to Solve]
- Raspberry pie import opencv error: ImportError: numpy.core.multiarray failed to import
- [Solved] OpenCV Import Error: ImportError: numpy.core.multiarray failed to import
- [Solved] module ‘numpy.random‘ has no attribute ‘default_rng‘ gensim.model