(array)
return array[idx]
Return the unique rows of the array.

    Parameters
    ----------
    array : ndarray
        A 2D numpy array.

    Returns
    -------
    unique_array : ndarray
        A 2D numpy array that contains all the unique rows of array.
Return the unique rows of the array.
Return the unique rows of the array .
def unique_rows(array):
    """Return the unique rows of the array.

    Parameters
    ----------
    array : ndarray
        A 2D numpy array.

    Returns
    -------
    unique_array : ndarray
        A 2D numpy array that contains all the unique rows of array.
    """
    array = np.ascontiguousarray(array)
    # Combine all the rows into a single element of the flexible void datatype
    dtype = np.dtype((np.void, array.dtype.itemsize * array.shape[1]))
    combined_array = array.view(dtype=dtype)
    # Get all the unique rows of the combined array
    _, idx = np.unique(combined_array, return_index=True)

    return array[idx]
def unique_rows ( array ) : array = np . ascontiguousarray ( array ) # Combine all the rows into a single element of the flexible void datatype dtype = np . dtype ( ( np . void , array . dtype . itemsize * array . shape [ 1 ] ) ) combined_array = array . view ( dtype = dtype ) # Get all the unique rows of the combined array _ , idx = np . unique ( combined_array , return_index = True ) return array [ idx ]