[SciPy-User] [scipy-user] How to remove a value from an np array?
Fri Jan 27 10:56:38 CST 2012
thanks a lot. Is there a way to do so but acting on elements array? I
explain you why. I have a vector with some 'nan' elements. I want to
remove them and to know the position on the array to remove another
element on another array but at the same 'place(position number)'
2012/1/27 Warren Weckesser <firstname.lastname@example.org>:
> On Fri, Jan 27, 2012 at 10:49 AM, Fabien Lafont <email@example.com>
>> I have that [3,2,4,8,7,8,9] and I want [3,2,8,7,8] how can I do? I've
>> tried remove() but it works only on lists not on np.array.
> In : a = array([3,2,4,8,7,8,9])
> In : b = a[(a != 4) & (a != 9)]
> In : b
> Out: array([3, 2, 8, 7, 8])
> SciPy-User mailing list
More information about the SciPy-User