I am trying to get a column using following command from an Excel file
i = pd.read_excel('filename.xlsx', sheet_name='sheet1')['column1']
In the past code was working well but today it suddenly stopped working with error.
I tried using different version of Pandas and NumPy but this did not work and gave the following error:
AttributeError: module 'numpy' has no attribute 'float'.
np.floatwas a deprecated alias for the builtinfloat. To avoid this error in existing code, usefloatby itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, usenp.float64here. 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
Does anyone know how to fix this instead of painfully trying different versions of Pandas and/or numpy?
In past code was working well but now it is not working at all.
numpy.floatwith NumPy 1.23.5. It produces a warning but works fine otherwise.pip install "numpy<1.24.0" "pandas==1.5.3". Don't forget to restart your kernel if you use a notebook.np.float? Your own code, or something you import? You seem to think it ispandas. Does the error traceback actually tell you that, or are you just guessing. The latest pandas version should have corrected this issue.