{ } Raw JSON

bundles / skimage latest / skimage / util / unique / unique_rows

function

skimage.util.unique:unique_rows

source: /dev/scikit-image/src/skimage/util/unique.py :4

Signature

def   unique_rows ( ar )

Summary

Remove repeated rows from a 2D array.

Extended Summary

In particular, if given an array of coordinates of shape (Npoints, Ndim), it will remove repeated points.

Parameters

ar : ndarray, shape (M, N)

The input array.

Returns

ar_out : ndarray, shape (P, N)

A copy of the input array with repeated rows removed.

Raises

ValueError : if `ar` is not two-dimensional.

Notes

The function will generate a copy of ar if it is not C-contiguous, which will negatively affect performance for large input arrays.

Examples

ar = np.array([[1, 0, 1],
               [0, 1, 0],
               [1, 0, 1]], np.uint8)
unique_rows(ar)

Aliases

  • skimage.util.unique_rows