def recarrayisin(X,Y,weak=True):
if (weak and set(X.dtype.names) != set(Y.dtype.names)) or(not weak and X.dtype.names != Y.dtype.names):<EOL><INDENT>return np.zeros((len(X),),bool)<EOL><DEDENT>else:<EOL><INDENT>if X.dtype.names != Y.dtype.names:<EOL><INDENT>Y = np.rec.fromarrays([Y[a] for a in X.dtype.names], <EOL>names=X.dtype.names)<EOL><DEDENT>NewX = np.array([str(l) for l in X])<EOL>NewY = np.array([str(l) for l in Y])<EOL>NewY.sort()<EOL>return isin(NewX,NewY)<EOL><DEDENT>
Indices of elements in a numpy record array (or ndarray with structured 
dtype) that appear in another.

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

        Z[i] = X[i] in Y

Record array version of func:`tabular.fast.isin`.

**Parameters**

        **X** :  numpy recarray

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

        **Y** :  numpy recarray

                Numpy recarray to which numpy recarray `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.isin`, :func:`tabular.fast.recarraydifference`