def isin(self, values):
if isinstance(values, dict):<EOL><INDENT>from pandas.core.reshape.concat import concat<EOL>values = collections.defaultdict(list, values)<EOL>return concat((self.iloc[:, [i]].isin(values[col])<EOL>for i, col in enumerate(self.columns)), axis=<NUM_LIT:1>)<EOL><DEDENT>elif isinstance(values, Series):<EOL><INDENT>if not values.index.is_unique:<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>return self.eq(values.reindex_like(self), axis='<STR_LIT:index>')<EOL><DEDENT>elif isinstance(values, DataFrame):<EOL><INDENT>if not (values.columns.is_unique and values.index.is_unique):<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>return self.eq(values.reindex_like(self))<EOL><DEDENT>else:<EOL><INDENT>if not is_list_like(values):<EOL><INDENT>raise TypeError("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>".format(type(values).__name__))<EOL><DEDENT>return DataFrame(<EOL>algorithms.isin(self.values.ravel(),<EOL>values).reshape(self.shape), self.index,<EOL>self.columns)<EOL><DEDENT>
Whether each element in the DataFrame is contained in values.

Parameters
----------
values : iterable, Series, DataFrame or dict
    The result will only be true at a location if all the
    labels match. If `values` is a Series, that's the index. If
    `values` is a dict, the keys must be the column names,
    which must match. If `values` is a DataFrame,
    then both the index and column labels must match.

Returns
-------
DataFrame
    DataFrame of booleans showing whether each element in the DataFrame
    is contained in values.

See Also
--------
DataFrame.eq: Equality test for DataFrame.
Series.isin: Equivalent method on Series.
Series.str.contains: Test if pattern or regex is contained within a
    string of a Series or Index.

Examples
--------

>>> df = pd.DataFrame({'num_legs': [2, 4], 'num_wings': [2, 0]},
...                   index=['falcon', 'dog'])
>>> df
        num_legs  num_wings
falcon         2          2
dog            4          0

When ``values`` is a list check whether every value in the DataFrame
is present in the list (which animals have 0 or 2 legs or wings)

>>> df.isin([0, 2])
        num_legs  num_wings
falcon      True       True
dog        False       True

When ``values`` is a dict, we can pass values to check for each
column separately:

>>> df.isin({'num_wings': [0, 3]})
        num_legs  num_wings
falcon     False      False
dog        False       True

When ``values`` is a Series or DataFrame the index and column must
match. Note that 'falcon' does not match based on the number of legs
in df2.

>>> other = pd.DataFrame({'num_legs': [8, 2], 'num_wings': [0, 2]},
...                      index=['spider', 'falcon'])
>>> df.isin(other)
        num_legs  num_wings
falcon      True       True
dog        False      False