[SciPy-user] Delete equal elements from array

fred fredmfp at gmail.com
Tue Feb 17 02:56:43 EST 2009


Sahar Vilan a écrit :
> Hi,
>  
> I have to exclude equal elements from an array.
> x1 = np.array([1, 4, 5, 5])
>  
> Is there any function to get from x1 an array with one element of each
> kind ( [1, 4, 5, 5] -> [1, 4, 5])?

np.unique(x1)?

Cheers,

-- 
Fred



More information about the SciPy-User mailing list