[SciPy-User] creating a view of an array

mathieu lacage mathieu.lacage at alcmeon.com
Sat Jul 30 16:39:40 EDT 2011


hi,

Let's say I have a big large array:

a = numpy.empty((10000*1000,10))

and I want to create a view of that array to be able to process a subset of
its data without making a copy.

One column:
b = a[:,1]

Two adjacent columns:
b = a[:,1:2]

Can I do the same (no memory allocation) for two columns that are not
adjacent ? i.e. if I want to create an array that is a view for the 1st and
3rd columns.


Mathieu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20110730/884f35d7/attachment.html>


More information about the SciPy-User mailing list