[SciPy-user] Delete equal elements from array

fred fredmfp@gmail....
Tue Feb 17 01:56:43 CST 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