[Numpy-discussion] Broadcasting with np.logical_and.reduce
antony.lee at berkeley.edu
Fri Sep 12 18:56:26 EDT 2014
I read the "Methods" section of the ufuncs doc page (
http://docs.scipy.org/doc/numpy/reference/ufuncs.html#methods) again and I
think this could be made clearer simply by replacing the first sentence from
"All ufuncs have four methods."
"All ufuncs have five methods that operate on array-like objects." (yes,
there's also "at", which seems to have been added later to the doc...)
This would make it somewhat clearer that
"logical_and.reduce([array([True, False], dtype=bool), array([True],
interprets the single list argument as an array-like (of dtype object)
rather than as an iterable over which to reduce (as python's builtin reduce
In fact there is another point in that paragraph that could be improved;
namely "axis" does not have to be an integer for "reduce".
2014-09-12 10:46 GMT-07:00 Robert Kern <robert.kern at gmail.com>:
> On Fri, Sep 12, 2014 at 5:46 PM, Robert Kern <robert.kern at gmail.com>
> > On Fri, Sep 12, 2014 at 5:44 PM, Antony Lee <antony.lee at berkeley.edu>
> >> I see. I went back to the documentation of ufunc.reduce and this is not
> >> explicitly mentioned although a posteriori it makes sense; perhaps this
> >> be made clearer there?
> > Please recommend the documentation you would like to see.
> Specifically, the behavior I described is the interaction of several
> different things, but you don't mention which part of it "is not
> explicitly mentioned".
> Robert Kern
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion