You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This behavior is broken in NumPy 1.7.0.dev-56f66bb, and the line above raises a ValueError. Is this a bug or a feature? Personally, I prefer the old behavior, as it allows the easy handling of special cases (zero-sized arrays) without the need for extra checks.
The text was updated successfully, but these errors were encountered:
It would be good to post this question on the numpy mailing list. The handling of empty arrays is something we want to sort out and it would be good to discuss this there.
This makes sense to me, it probably changed when I rewrote the ufunc 'reduce' method to optimize its cache-coherency and add NA support. I'm not sure if it's flogging a dead horse to mention that there should have been a unit test for this so it would have been caught during development instead of now.
A patch is here, but not making a PR yet because there is a traffic jam there. I'd rather not have 3 conflicting PRs all outstanding at once :-) So noting to make sure it won't get lost.
Original ticket http://projects.scipy.org/numpy/ticket/2078 on 2012-03-11 by trac user muellner, assigned to unknown.
[]In NumPy release 1.5.1, the minimum/maximum/mean of empty arrays is handled in a sensible way, namely by returning an empty array:
Likewise for max and mean.
This behavior is broken in NumPy 1.7.0.dev-56f66bb, and the line above raises a ValueError. Is this a bug or a feature? Personally, I prefer the old behavior, as it allows the easy handling of special cases (zero-sized arrays) without the need for extra checks.
The text was updated successfully, but these errors were encountered: