ó
 \c           @   s   d  d l  Z d   Z d S(   i˙˙˙˙Nc         C   s~   |  j  d k r% t d |  j    n  t j |   }  |  j d |  j |  j d  } t j | d t \ } } |  | } | S(   s'  Remove repeated rows from a 2D array.

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

    Parameters
    ----------
    ar : 2-D ndarray
        The input array.

    Returns
    -------
    ar_out : 2-D ndarray
        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)
    array([[0, 1, 0],
           [1, 0, 1]], dtype=uint8)
    i   s5   unique_rows() only makes sense for 2D arrays, got %dds   |S%di   t   return_index(	   t   ndimt
   ValueErrort   npt   ascontiguousarrayt   viewt   itemsizet   shapet   uniquet   True(   t   art   ar_row_viewt   _t   unique_row_indicest   ar_out(    (    s2   lib/python2.7/site-packages/skimage/util/unique.pyt   unique_rows   s    #!
(   t   numpyR   R   (    (    (    s2   lib/python2.7/site-packages/skimage/util/unique.pyt   <module>   s   