[Numpy-discussion] idiom for deleting array elements
martin.wiechert at gmx.de
Tue Nov 28 09:59:22 CST 2006
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.
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 (briefer, not requiring temporary boolean array)?
More information about the Numpy-discussion