Re: [Numpy-discussion] Broadcasting with np.logical_and.reduce

2014-09-12 Thread Antony Lee
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." to "All ufuncs have five methods that operate on array-lik

Re: [Numpy-discussion] Broadcasting with np.logical_and.reduce

2014-09-12 Thread Robert Kern
On Fri, Sep 12, 2014 at 5:46 PM, Robert Kern wrote: > On Fri, Sep 12, 2014 at 5:44 PM, Antony Lee wrote: >> 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 can >> be made clearer there? > > Please

Re: [Numpy-discussion] Broadcasting with np.logical_and.reduce

2014-09-12 Thread Robert Kern
On Fri, Sep 12, 2014 at 5:44 PM, Antony Lee wrote: > 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 can > be made clearer there? Please recommend the documentation you would like to see. -- Rober

Re: [Numpy-discussion] Broadcasting with np.logical_and.reduce

2014-09-12 Thread Antony Lee
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 can be made clearer there? Antony 2014-09-12 2:22 GMT-07:00 Robert Kern : > On Fri, Sep 12, 2014 at 10:04 AM, Antony Lee > wrote: > > I am not using as

Re: [Numpy-discussion] Broadcasting with np.logical_and.reduce

2014-09-12 Thread Robert Kern
On Fri, Sep 12, 2014 at 10:04 AM, Antony Lee wrote: > I am not using asarray here. Sorry, but I don't see how this is relevant -- > my comparison with np.add.reduce is simply that when a list of float arrays > is passed to np.add.reduce, broadcasting happens as usual, but not when a > list of boo

Re: [Numpy-discussion] Broadcasting with np.logical_and.reduce

2014-09-12 Thread Antony Lee
I am not using asarray here. Sorry, but I don't see how this is relevant -- my comparison with np.add.reduce is simply that when a list of float arrays is passed to np.add.reduce, broadcasting happens as usual, but not when a list of bool arrays is passed to np.logical_and.reduce. 2014-09-12 0:48

Re: [Numpy-discussion] Broadcasting with np.logical_and.reduce

2014-09-12 Thread Sebastian Berg
On Do, 2014-09-11 at 22:54 -0700, Antony Lee wrote: > Hi, > I thought that ufunc.reduce performs broadcasting, but it seems a bit > confused by boolean arrays: > > > In [1]: add.reduce([array([1, 2]), array([1])]) > Out[1]: array([2, 3]) > In [2]: logical_and.reduce([array([True, False], dtype=bo

[Numpy-discussion] Broadcasting with np.logical_and.reduce

2014-09-11 Thread Antony Lee
Hi, I thought that ufunc.reduce performs broadcasting, but it seems a bit confused by boolean arrays: In [1]: add.reduce([array([1, 2]), array([1])]) Out[1]: array([2, 3]) In [2]: logical_and.reduce([array([True, False], dtype=bool), array([True], dtype=bool)]) ---