[Numpy-discussion] Extracting sub-fields from an array as a view (PR 350)
Sat Jul 14 19:17:28 CDT 2012
+1 for more views. I agree with Fred about bundling the changes together.
On Sat, Jul 14, 2012 at 6:17 PM, Frédéric Bastien <firstname.lastname@example.org> wrote:
> I think it is better that we bundle those change together. As it is
> done for diagonal, doing it for this case as fine too.
> On Sat, Jul 14, 2012 at 6:31 PM, Travis Oliphant <email@example.com>
> > In https://github.com/numpy/numpy/pull/350/files ,
> > javius provides a patch to allow field extraction from a structured
> array to
> > return a view instead of a copy. Generally, this is consistent with
> > desire to have NumPy return views whenever it can. The same idea
> > the change to the diagonal method.
> > Suppose 'myarr' is a structured array with fields ['lat', 'long',
> > 'meas2', 'meas3', 'meas4'].
> > Currently,
> > myarr[['lat', 'long', 'mesa3']] will return a copy of the data in the
> > underlying array. The proposal is to have this return a view, but do
> it in
> > a two-stage approach so that a first version returns a copy with the
> > WARN_ON_WRITE flag set introduced in NumPy 1.7. A later version will
> > remove the flag (and the copy).
> > What are thoughts on this proposal and which version of NumPy it should
> > in?
> > -Travis
> > _______________________________________________
> > NumPy-Discussion mailing list
> > NumPy-Discussion@scipy.org
> > http://mail.scipy.org/mailman/listinfo/numpy-discussion
> NumPy-Discussion mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion