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

Warning: Creating an ndarray from ragged nested sequences is deprecated #49

Closed
brl0 opened this issue Aug 1, 2020 · 4 comments
Closed
Labels
bug Something isn't working

Comments

@brl0
Copy link
Collaborator

brl0 commented Aug 1, 2020

This warning occurs numerous times during testing.

tests/test_fixedextensionarray.py: 191 warnings
tests/test_geodataframe.py: 1 warning
tests/geometry/test_to_geopandas.py: 2 warnings
/home/travis/miniconda/envs/test-environment/lib/python3.7/site-packages/numpy/core/_asarray.py:83: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray
return array(a, dtype, copy=False, order=order)

This occurs with the latest version of spatialpandas, and numpy 1.19.1.

@jbednar jbednar added this to the v0.3.6 milestone Aug 6, 2020
@jbednar
Copy link
Member

jbednar commented Aug 7, 2020

Hmm. Creating arrays with dtype=object isn't normally advisable, so I can see why it would be warning. It's fine for code used only in testing, but if the actual issue is in the main codebase, it does sound like something that needs fixing.

@philippjfr philippjfr modified the milestones: v0.3.6, v0.3.7 Aug 16, 2020
@jlstevens jlstevens added the bug Something isn't working label Dec 7, 2020
@jlstevens
Copy link
Collaborator

I'm tagging this as a bug as having lots of warnings appear is very annoying (even if everything else is working).

@ianthomas23
Copy link
Member

Most these warnings have been fixed as part of #92. One remains:

array = np.asarray(array)

We cannot force a dtype=object here, so it needs further consideration.

@ianthomas23
Copy link
Member

Closed by #107.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants