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

is_list_like returns True for zero-dimensional ndarrays #19011

Closed
jbrockmendel opened this issue Dec 31, 2017 · 1 comment · Fixed by #21861
Closed

is_list_like returns True for zero-dimensional ndarrays #19011

jbrockmendel opened this issue Dec 31, 2017 · 1 comment · Fixed by #21861
Labels
API Design Dtype Conversions Unexpected or buggy dtype conversions
Milestone

Comments

@jbrockmendel
Copy link
Member

But calling len(x) for such an object raises.

@jreback
Copy link
Contributor

jreback commented Dec 31, 2017

yeah these are slightly different , [11] is a true scalar, while [13] is a 0-dim array (which is generally odd)

In [11]: pd.api.types.is_list_like(np.int64(1))
Out[11]: False

In [13]: pd.api.types.is_list_like(np.array(1))
Out[13]: True

@jreback jreback added API Design Dtype Conversions Unexpected or buggy dtype conversions labels Dec 31, 2017
jbrockmendel added a commit to jbrockmendel/pandas that referenced this issue Jul 11, 2018
@jreback jreback added this to the 0.24.0 milestone Jul 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Design Dtype Conversions Unexpected or buggy dtype conversions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants