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