-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
bug in apply_along_axis with empty arrays #6927
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
Comments
This seems tricky. How should |
Maybe a solution could be to provide a kwarg that informs about the output size along that dimension. For reductions it is always 1 after all. This is a problem even for internal fuctions like the nanfuncs I guess? |
Is this a regression? |
No, it's not a regression (just checked with v1.7.2). |
Hmm, a keyword seems like an ugly solution to me. I'd rather just try figuring it out with a dummy array. Or simply catch |
I don't understand how a dummy array solves the problem - what we want to know is what shape the function's return value would have been if there had been an array there to call it on. In general this could depend on anything, though, including the values that would have been in that array if it existed... When in doubt refuse to guess and all that. A better error message and a kwarg both seem like good improvements to me though. |
@njsmith :
Right, but this is already assumed not to be the case in |
Still present in numpy 1.10.2:
The text was updated successfully, but these errors were encountered: