[Numpy-discussion] Is this a bug in numpy.ma.reduce?

Friedrich Romstedt friedrichromstedt at gmail.com
Sun Mar 7 07:41:27 EST 2010

2010/3/5 Pierre GM <pgmdevlist at gmail.com>:
> 'm'fraid no. I gonna have to investigate that. Please open a ticket with a self-contained example that reproduces the issue.
> Thx in advance...
> P.

I would like to stress the fact that imo this is maybe not ticket and not a bug.

The issue arises when calling a.max() or similar of empty arrays a, i.e., with:

>>> 0 in a.shape

Opposed to the .prod() of an empty array, such a .max() or .min()
cannot be defined, because the set is empty.  So it's fully correct to
let such calls fail.  Just the failure is a bit deep in numpy, and
only the traceback gives some hint what went wrong.

I posted something similar also on the matplotlib-users list, sorry
for cross-posting thus.


More information about the NumPy-Discussion mailing list