Re: [Numpy-discussion] Fwd: Getting subarray

2007-04-23 Thread Steve Lianoglou
> I have two arrays: > > a = numpy.array([0,1,2,3,4,5,6,7,8,9]) > b = numpy.array([0,0,1,1,2,2,0,1,2,3]) > > I would like to get the part of a that corresponds > to where b is equal to i. > > For example: > > i = 0 => ([0,1,6]) > i = 1 => ([2,3,7]) a[b == 1] and a[b == 0] work too, btw. -ste

Re: [Numpy-discussion] Fwd: Getting subarray

2007-04-23 Thread Gael Varoquaux
On Mon, Apr 23, 2007 at 11:44:08AM -0400, Steve Lianoglou wrote: > > I have two arrays: > > a = numpy.array([0,1,2,3,4,5,6,7,8,9]) > > b = numpy.array([0,0,1,1,2,2,0,1,2,3]) > > I would like to get the part of a that corresponds > > to where b is equal to i. > > For example: > > i = 0 => ([0,1,

Re: [Numpy-discussion] Fwd: Getting subarray

2007-04-23 Thread Steve Lianoglou
Hi, On Apr 23, 2007, at 11:30 AM, Tommy Grav wrote: > I have two arrays: > > a = numpy.array([0,1,2,3,4,5,6,7,8,9]) > b = numpy.array([0,0,1,1,2,2,0,1,2,3]) > > I would like to get the part of a that corresponds > to where b is equal to i. > > For example: > > i = 0 => ([0,1,6]) > i = 1 => ([2,3,

[Numpy-discussion] Fwd: Getting subarray

2007-04-23 Thread Tommy Grav
I have two arrays: a = numpy.array([0,1,2,3,4,5,6,7,8,9]) b = numpy.array([0,0,1,1,2,2,0,1,2,3]) I would like to get the part of a that corresponds to where b is equal to i. For example: i = 0 => ([0,1,6]) i = 1 => ([2,3,7]) Cheers Tommy ___ Num