python - Removing a row in a numpy recarray -
is there convenient way delete row containing value in recarray? have following array,
a=numpy.array([(1.0, 2.0, 3.0), (4.0, 5.0, 10.0),(1.0,10.0,4.0)], dtype=[('a', '<f8'), ('b', '<f8'), ('c', '<f8')])
and wanted remove rows 10 in b column output is
([(1.0, 2.0, 3.0), (4.0, 5.0, 10.0)], dtype=[('a', '<f8'), ('b', '<f8'), ('c', '<f8')])
is there quick way this?
just pull out relevant rows of original array:
new_a = a[a["b"]!=10.0]
Comments
Post a Comment