Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

np.float is a deprecated alias for the builtin float #69

Open
serhii73 opened this issue Dec 20, 2022 · 0 comments · May be fixed by #70
Open

np.float is a deprecated alias for the builtin float #69

serhii73 opened this issue Dec 20, 2022 · 0 comments · May be fixed by #70

Comments

@serhii73
Copy link

Hi,

In [1]: import numpy as np

In [2]: np.__version__
Out[2]: '1.24.0'

In [3]: np.float(3)
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[3], line 1
----> 1 np.float(3)

File ~/.pyenv/versions/3.10.6/lib/python3.10/site-packages/numpy/__init__.py:284, in __getattr__(attr)
    281     from .testing import Tester
    282     return Tester
--> 284 raise AttributeError("module {!r} has no attribute "
    285                      "{!r}".format(__name__, attr))

AttributeError: module 'numpy' has no attribute 'float'

When we install the reverse-geocoder, we install the latest version of numpy. And unfortunately, we get an error. A simple solution to this is to change the requirements file pip install "numpy>=1.11.0, <1.24"

In [2]: import numpy as np

In [3]: np.__version__
Out[3]: '1.23.5'

In [4]: np.float(3)
<ipython-input-4-8262e04d58e1>:1: DeprecationWarning: `np.float` is a deprecated alias for the builtin `float`. To silence this warning, 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.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
  np.float(3)
Out[4]: 3.0
serhii73 added a commit to serhii73/reverse-geocoder that referenced this issue Dec 20, 2022
@serhii73 serhii73 linked a pull request Dec 20, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant