[Numpy-discussion] removing and replacing certain values in arrays

Robert Kern robert.kern at gmail.com
Mon Jul 7 16:38:33 EDT 2008


On Mon, Jul 7, 2008 at 15:08, Tim Michelsen <timmichelsen at gmx-topmail.de> wrote:
> Hello,
> how do I remove all rows (or column) from an array which contain a
> certain  value or sting?

Modification in-place is not possible. You will have to make a boolean
mask, then use boolean indexing to pull out a new array with the
desired values removed.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
 -- Umberto Eco



More information about the NumPy-Discussion mailing list