def isin(X,Y):
if len(Y) > <NUM_LIT:0>:<EOL><INDENT>T = Y.copy()<EOL>T.sort()<EOL>D = T.searchsorted(X)<EOL>T = np.append(T,np.array([<NUM_LIT:0>]))<EOL>W = (T[D] == X)<EOL>if isinstance(W,bool):<EOL><INDENT>return np.zeros((len(X),),bool)<EOL><DEDENT>else:<EOL><INDENT>return (T[D] == X)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>return np.zeros((len(X),),bool)<EOL><DEDENT>
Indices of elements in a numpy array that appear in another.

Fast routine for determining indices of elements in numpy array `X` that 
appear in numpy array `Y`, returning a boolean array `Z` such that::

        Z[i] = X[i] in Y

**Parameters**

        **X** :  numpy array

                Numpy array to comapare to numpy array `Y`.  For each 
                element of `X`, ask if it is in `Y`.

        **Y** :  numpy array

                Numpy array to which numpy array `X` is compared.  For each 
                element of `X`, ask if it is in `Y`.

**Returns**

        **b** :  numpy array (bool)

                Boolean numpy array, `len(b) = len(X)`.

**See Also:**

        :func:`tabular.fast.recarrayisin`, 
        :func:`tabular.fast.arraydifference`