Re: [Numpy-discussion] numpy reference array

2013-03-18 Thread Matt U
Chris Barker - NOAA Federal noaa.gov> writes: > check out "stride tricks" for clever things you can do. > > But numpy does require that the data in your array be a contiguous > block, in order, so you can't arbitrarily re-arrange it while keeping > a view. > > HTH, > -Chris > Hi Chris, Than

Re: [Numpy-discussion] numpy reference array

2013-03-13 Thread Chris Barker - NOAA Federal
On Wed, Mar 13, 2013 at 6:56 AM, Matt U wrote: > Is it possible to create a numpy array which points to the same data in a > different numpy array (but in different order etc)? You can do this (easily), but only if the "different order" can be defined in terms of strides. A simple example is a tr

[Numpy-discussion] numpy reference array

2013-03-13 Thread Matt U
Is it possible to create a numpy array which points to the same data in a different numpy array (but in different order etc)? For example: Code: -- import numpy as np a = np.arange(10) ids = np.array([0,0,5,5,9,9,1,1]) b