Skip to content

BUG: np.apply_along_axis produces nested object scalars #8642

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

Closed
eric-wieser opened this issue Feb 19, 2017 · 0 comments
Closed

BUG: np.apply_along_axis produces nested object scalars #8642

eric-wieser opened this issue Feb 19, 2017 · 0 comments

Comments

@eric-wieser
Copy link
Member

eric-wieser commented Feb 19, 2017

"Regression" from #8441:

>>> np.apply_along_axis(lambda x: set(x), 1, [[1, 2, 3]])
array([array({1, 2, 3}, dtype=object)], dtype=object)

Expected

array([{1, 2, 3}], dtype=object)

Before the #8441 patch (#5248):

array([[{1, 2, 3}, {1, 2, 3}, {1, 2, 3}]], dtype=object)

This comes down to the fact that arr[...] = np.array(a_scalar) does a different thing when the scalar is of object dtype

eric-wieser added a commit to eric-wieser/numpy that referenced this issue Apr 6, 2017
@eric-wieser eric-wieser changed the title np.apply_along_axis produces nested object scalars BUG: np.apply_along_axis produces nested object scalars Apr 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant