[Numpy-discussion] Selection of only a certain number of fields

Stéfan van der Walt stefan@sun.ac...
Fri Feb 6 03:12:31 CST 2009

Hi Travis

2009/2/6 Travis Oliphant <oliphant@enthought.com>:
> Thus  newarr = arr[['name', 'age']].copy() would be exactly the same
> size as arr because elements are  copied wholesale and each "row" is a
> single element in the NumPy array.    Some infrastructure would have to
> be implemented at a fundamental level to handle partial-element
> manipulation similar at least in spirit to what is needed to handle
> bit-level striding on a fundamental level.

I like your suggestion!  Can you think of a way to implement #2 with
the correct copy semantics?  Being able to create a view without
copying is such a big plus that it is worth considering, even at an
implementation cost.


More information about the Numpy-discussion mailing list