Re: [Numpy-discussion] Multiple-field indexing: view vs copy in 1.14+

2018-01-27 Thread Allan Haldane
On 01/25/2018 03:56 PM, josef.p...@gmail.com wrote: On Thu, Jan 25, 2018 at 1:49 PM, Marten van Kerkwijk mailto:m.h.vankerkw...@gmail.com>> wrote: On Thu, Jan 25, 2018 at 1:16 PM, Stefan van der Walt mailto:stef...@berkeley.edu>> wrote: > On Mon, 22 Jan 2018 10:11:08 -0500, Marte

Re: [Numpy-discussion] Multiple-field indexing: view vs copy in 1.14+

2018-01-25 Thread josef . pktd
On Thu, Jan 25, 2018 at 1:49 PM, Marten van Kerkwijk < m.h.vankerkw...@gmail.com> wrote: > On Thu, Jan 25, 2018 at 1:16 PM, Stefan van der Walt > wrote: > > On Mon, 22 Jan 2018 10:11:08 -0500, Marten van Kerkwijk wrote: > >> > >> I think on the consistency argument is perhaps the most important:

Re: [Numpy-discussion] Multiple-field indexing: view vs copy in 1.14+

2018-01-25 Thread Marten van Kerkwijk
On Thu, Jan 25, 2018 at 1:16 PM, Stefan van der Walt wrote: > On Mon, 22 Jan 2018 10:11:08 -0500, Marten van Kerkwijk wrote: >> >> I think on the consistency argument is perhaps the most important: >> views are very powerful and in many ways one *counts* on them >> happening, especially in working

Re: [Numpy-discussion] Multiple-field indexing: view vs copy in 1.14+

2018-01-25 Thread Stefan van der Walt
On Mon, 22 Jan 2018 10:11:08 -0500, Marten van Kerkwijk wrote: I think on the consistency argument is perhaps the most important: views are very powerful and in many ways one *counts* on them happening, especially in working with large arrays. I had the same gut feeling, but the fancy indexing

Re: [Numpy-discussion] Multiple-field indexing: view vs copy in 1.14+

2018-01-22 Thread Allan Haldane
On 01/22/2018 11:23 AM, Allan Haldane wrote: > I just want to note that I > thought of another way to "fix" this for 1.15 which does not involve > "pack_fields", which is > >     a[['b', 'c']].astype('f8,f8').view(('f8', 2)) > > Which is back-compatible will numpy back to 1.7, I think. Apologies

Re: [Numpy-discussion] Multiple-field indexing: view vs copy in 1.14+

2018-01-22 Thread josef . pktd
On Mon, Jan 22, 2018 at 11:13 AM, Allan Haldane wrote: > On 01/22/2018 10:53 AM, josef.p...@gmail.com wrote: > >> >> This is similar to the above example >> a[['a', 'c']].view('i8') >> but it doesn't try to combine fields. >> >> In many examples where I used structured dtypes a long time ago, >>

Re: [Numpy-discussion] Multiple-field indexing: view vs copy in 1.14+

2018-01-22 Thread Allan Haldane
On 01/22/2018 10:53 AM, josef.p...@gmail.com wrote: On Sun, Jan 21, 2018 at 9:48 PM, Allan Haldane In  many examples where I used structured dtypes a long time ago, switched between consistent views as either a standard array of subsets or as .structured dtypes. For this usecase it wouldn't mat

Re: [Numpy-discussion] Multiple-field indexing: view vs copy in 1.14+

2018-01-22 Thread Allan Haldane
On 01/22/2018 10:53 AM, josef.p...@gmail.com wrote: This is similar to the above example a[['a', 'c']].view('i8') but it doesn't try to combine fields. In  many examples where I used structured dtypes a long time ago, switched between consistent views as either a standard array of subsets or

Re: [Numpy-discussion] Multiple-field indexing: view vs copy in 1.14+

2018-01-22 Thread josef . pktd
On Mon, Jan 22, 2018 at 10:53 AM, wrote: > > > On Sun, Jan 21, 2018 at 9:48 PM, Allan Haldane > wrote: > >> Hello all, >> >> We are making a decision (again) about what to do about the >> behavior of multiple-field indexing of structured arrays: Should >> it return a view or a copy, and on what

Re: [Numpy-discussion] Multiple-field indexing: view vs copy in 1.14+

2018-01-22 Thread josef . pktd
On Sun, Jan 21, 2018 at 9:48 PM, Allan Haldane wrote: > Hello all, > > We are making a decision (again) about what to do about the > behavior of multiple-field indexing of structured arrays: Should > it return a view or a copy, and on what release schedule? > > As a reminder, this refers to opera

Re: [Numpy-discussion] Multiple-field indexing: view vs copy in 1.14+

2018-01-22 Thread Marten van Kerkwijk
Hi Allan, I think on the consistency argument is perhaps the most important: views are very powerful and in many ways one *counts* on them happening, especially in working with large arrays. They really should be used everywhere it is possible. In this respect, I think one has to weigh breakage of

[Numpy-discussion] Multiple-field indexing: view vs copy in 1.14+

2018-01-21 Thread Allan Haldane
Hello all, We are making a decision (again) about what to do about the behavior of multiple-field indexing of structured arrays: Should it return a view or a copy, and on what release schedule? As a reminder, this refers to operations like (1.13 behavior): >>> a = np.zeros(3, dtype=[('a', '