Re: [Numpy-discussion] idiom for deleting array elements

2006-11-28 Thread Martin Wiechert
Perfect, thanks! Martin On Tuesday 28 November 2006 17:31, Stefan van der Walt wrote: > On Tue, Nov 28, 2006 at 04:59:22PM +0100, Martin Wiechert wrote: > > I'm looking for an idiom to delete a sparse subset S (given as integer > > indices into A) of elements from a 1d array A. > > > > Something

Re: [Numpy-discussion] idiom for deleting array elements

2006-11-28 Thread Stefan van der Walt
On Tue, Nov 28, 2006 at 04:59:22PM +0100, Martin Wiechert wrote: > I'm looking for an idiom to delete a sparse subset S (given as integer > indices > into A) of elements from a 1d array A. > > Something like > > del L [I] > > if L is a list and I is a non-fancy index. > > My best idea is > >

[Numpy-discussion] idiom for deleting array elements

2006-11-28 Thread Martin Wiechert
Hi list, I'm looking for an idiom to delete a sparse subset S (given as integer indices into A) of elements from a 1d array A. Something like del L [I] if L is a list and I is a non-fancy index. My best idea is B = ones (A.shape, bool) B [S] = False A = A [B] Is there a better idiom (briefe