Re: isnan

2010-10-12 Thread Andre Alexander Bell
On 10/12/2010 06:22 PM, Ian Kelly wrote: > That's the inverse of what the OP wanted. The full solution: > >>>> A[~isnan(B)] > array([2, 3]) Indeed, you are right Ian. Thanks for pointing that out. :) Sorry for the mistake. Regards Andre -- http://mail.python.org/mailman/listinfo/python-list

Re: isnan

2010-10-12 Thread Ian Kelly
; > is nan. How can I do. > > > > Similar to the matlab code A(find(isnan(B)) = [] > > How about this: > > >>> from numpy import NAN > >>> A = np.array([1,2,3,4,5]) > >>> B = np.array([NAN,2,3,NAN,NAN]) > >>> A = A[isnan(B)] &g

Re: isnan

2010-10-11 Thread Andre Alexander Bell
Hi Kenny, On 10/12/2010 05:58 AM, Kenny wrote: > I have an array A, and another one B with same dimention and size. Now I > want to change the delete the elements in A where the same position in B > is nan. How can I do. > > Similar to the matlab code A(find(isnan(B)) = []

isnan

2010-10-11 Thread Kenny
Hi All, I have an array A, and another one B with same dimention and size. Now I want to change the delete the elements in A where the same position in B is nan. How can I do. Similar to the matlab code A(find(isnan(B)) = [] Thank you. -- Best regards, Kenny -- http://mail.python.org