[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)]) ---

Re: [Numpy-discussion] @ operator

2014-09-11 Thread Nathaniel Smith
On Thu, Sep 11, 2014 at 11:18 PM, Charles R Harris wrote: > > On Thu, Sep 11, 2014 at 8:49 PM, Nathaniel Smith wrote: >> >> On Thu, Sep 11, 2014 at 10:12 PM, Charles R Harris >> wrote: >> > >> > On Thu, Sep 11, 2014 at 8:01 PM, Nathaniel Smith wrote: >> >> >> >> On Thu, Sep 11, 2014 at 12:10 PM

Re: [Numpy-discussion] @ operator

2014-09-11 Thread Charles R Harris
On Thu, Sep 11, 2014 at 8:49 PM, Nathaniel Smith wrote: > On Thu, Sep 11, 2014 at 10:12 PM, Charles R Harris > wrote: > > > > On Thu, Sep 11, 2014 at 8:01 PM, Nathaniel Smith wrote: > >> > >> On Thu, Sep 11, 2014 at 12:10 PM, Charles R Harris > >> wrote: > >> > > >> > On Wed, Sep 10, 2014 at 1

Re: [Numpy-discussion] @ operator

2014-09-11 Thread Nathaniel Smith
On Thu, Sep 11, 2014 at 10:12 PM, Charles R Harris wrote: > > On Thu, Sep 11, 2014 at 8:01 PM, Nathaniel Smith wrote: >> >> On Thu, Sep 11, 2014 at 12:10 PM, Charles R Harris >> wrote: >> > >> > On Wed, Sep 10, 2014 at 10:08 PM, Nathaniel Smith wrote: >> >> >> >> My vote is: >> >> >> >> __matmu

Re: [Numpy-discussion] @ operator

2014-09-11 Thread Charles R Harris
On Thu, Sep 11, 2014 at 8:01 PM, Nathaniel Smith wrote: > On Thu, Sep 11, 2014 at 12:10 PM, Charles R Harris > wrote: > > > > On Wed, Sep 10, 2014 at 10:08 PM, Nathaniel Smith wrote: > >> > >> My vote is: > >> > >> __matmul__/__rmatmul__ do the standard dispatch stuff that all __op__ > >> metho

Re: [Numpy-discussion] @ operator

2014-09-11 Thread Charles R Harris
On Thu, Sep 11, 2014 at 7:47 PM, Charles R Harris wrote: > > > On Thu, Sep 11, 2014 at 10:10 AM, Charles R Harris < > charlesr.har...@gmail.com> wrote: > >> >> >> On Wed, Sep 10, 2014 at 10:08 PM, Nathaniel Smith wrote: >> >>> On Wed, Sep 10, 2014 at 4:53 PM, Charles R Harris >>> wrote: >>> > >

Re: [Numpy-discussion] @ operator

2014-09-11 Thread Nathaniel Smith
On Thu, Sep 11, 2014 at 12:10 PM, Charles R Harris wrote: > > On Wed, Sep 10, 2014 at 10:08 PM, Nathaniel Smith wrote: >> >> My vote is: >> >> __matmul__/__rmatmul__ do the standard dispatch stuff that all __op__ >> methods do (so I guess check __array_priority__ or whatever it is we >> always do

Re: [Numpy-discussion] @ operator

2014-09-11 Thread Charles R Harris
On Thu, Sep 11, 2014 at 10:10 AM, Charles R Harris < charlesr.har...@gmail.com> wrote: > > > On Wed, Sep 10, 2014 at 10:08 PM, Nathaniel Smith wrote: > >> On Wed, Sep 10, 2014 at 4:53 PM, Charles R Harris >> wrote: >> > >> > On Wed, Sep 10, 2014 at 10:52 AM, Pauli Virtanen wrote: >> >> >> >> 09

Re: [Numpy-discussion] @ operator

2014-09-11 Thread Charles R Harris
On Wed, Sep 10, 2014 at 10:08 PM, Nathaniel Smith wrote: > On Wed, Sep 10, 2014 at 4:53 PM, Charles R Harris > wrote: > > > > On Wed, Sep 10, 2014 at 10:52 AM, Pauli Virtanen wrote: > >> > >> 09.09.2014, 22:52, Charles R Harris kirjoitti: > >> > 1. Should the operator accept array_like for on

[Numpy-discussion] How to get docs for functions processed by numpy.vectorize?

2014-09-11 Thread John Haiducek
When I apply numpy.vectorize() to a function, documentation tools behave inconsistently with regard to the new, vectorized function. The function's __doc__ attribute does contain the docstring of the original function as expected, but the built-in help() command displays the documentation of th

Re: [Numpy-discussion] why does u.resize return None?

2014-09-11 Thread Neal Becker
https://github.com/numpy/numpy/issues/5064 Eelco Hoogendoorn wrote: > agreed; I never saw the logic in returning none either. > > On Thu, Sep 11, 2014 at 4:27 PM, Neal Becker wrote: > >> It would be useful if u.resize returned the new array, so it could be used >> for >> chaining operations >>

Re: [Numpy-discussion] why does u.resize return None?

2014-09-11 Thread Robert Kern
On Thu, Sep 11, 2014 at 3:27 PM, Neal Becker wrote: > It would be useful if u.resize returned the new array, so it could be used for > chaining operations Same reason why list.sort() and friends return None. https://docs.python.org/2/faq/design.html#why-doesn-t-list-sort-return-the-sorted-list

Re: [Numpy-discussion] why does u.resize return None?

2014-09-11 Thread Eelco Hoogendoorn
agreed; I never saw the logic in returning none either. On Thu, Sep 11, 2014 at 4:27 PM, Neal Becker wrote: > It would be useful if u.resize returned the new array, so it could be used > for > chaining operations > > -- > -- Those who don't understand recursion are doomed to repeat it > > __

[Numpy-discussion] why does u.resize return None?

2014-09-11 Thread Neal Becker
It would be useful if u.resize returned the new array, so it could be used for chaining operations -- -- Those who don't understand recursion are doomed to repeat it ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/ma