Re: [Numpy-discussion] np.nonzero - order guarantees?

2015-07-28 Thread Sebastian Berg
On Tue Jul 28 18:18:01 2015 GMT+0200, Matthew Brett wrote: > On Tue, Jul 28, 2015 at 4:45 PM, Sebastian Berg > wrote: > > Yes, I think it is guaranteed C order in the results. > > > > > > On Mon Jul 27 14:05:01 2015 GMT+0200, Matthew Brett wrote: > >> Hi, > >> > >> `np.nonzero` for a 2D array `A`

Re: [Numpy-discussion] np.nonzero - order guarantees?

2015-07-28 Thread Matthew Brett
On Tue, Jul 28, 2015 at 4:45 PM, Sebastian Berg wrote: > Yes, I think it is guaranteed C order in the results. > > > On Mon Jul 27 14:05:01 2015 GMT+0200, Matthew Brett wrote: >> Hi, >> >> `np.nonzero` for a 2D array `A` returns: >> >> row_inds, col_inds = np.nonzero(A) >> >> I notice that `row_in

Re: [Numpy-discussion] Shared memory check on in-place modification.

2015-07-28 Thread Sebastian Berg
On Mon Jul 27 22:51:52 2015 GMT+0200, Sturla Molden wrote: > On 27/07/15 22:10, Anton Akhmerov wrote: > > Hi everyone, > > > > I have encountered an initially rather confusing problem in a piece of > > code that attempted to symmetrize a matrix: `h += h.T` > > The problem of course appears due to

Re: [Numpy-discussion] np.nonzero - order guarantees?

2015-07-28 Thread Sebastian Berg
Yes, I think it is guaranteed C order in the results. On Mon Jul 27 14:05:01 2015 GMT+0200, Matthew Brett wrote: > Hi, > > `np.nonzero` for a 2D array `A` returns: > > row_inds, col_inds = np.nonzero(A) > > I notice that `row_inds` appears to be sorted by value, and `col_inds` > appears to be