Return the sorted, unique elements of an array or sequence.
x : array_like
Input array.
y : ndarray
The sorted, unique elements are returned in a 1-D array.
Examples
>>> np.unique([1, 1, 2, 2, 3, 3]) array([1, 2, 3]) >>> a = np.array([[1, 1], [2, 3]]) >>> np.unique(a) array([1, 2, 3])
numpy.trim_zeros
numpy.fliplr