def isin(comps, values):
if not is_list_like(comps):<EOL><INDENT>raise TypeError("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>.format(comps_type=type(comps).__name__))<EOL><DEDENT>if not is_list_like(values):<EOL><INDENT>raise TypeError("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>.format(values_type=type(values).__name__))<EOL><DEDENT>if not isinstance(values, (ABCIndex, ABCSeries, np.ndarray)):<EOL><INDENT>values = construct_1d_object_array_from_listlike(list(values))<EOL><DEDENT>if is_categorical_dtype(comps):<EOL><INDENT>return comps._values.isin(values)<EOL><DEDENT>comps = com.values_from_object(comps)<EOL>comps, dtype, _ = _ensure_data(comps)<EOL>values, _, _ = _ensure_data(values, dtype=dtype)<EOL>f = lambda x, y: htable.ismember_object(x, values)<EOL>if len(comps) > <NUM_LIT> and not is_object_dtype(comps):<EOL><INDENT>f = lambda x, y: np.in1d(x, y)<EOL><DEDENT>elif is_integer_dtype(comps):<EOL><INDENT>try:<EOL><INDENT>values = values.astype('<STR_LIT>', copy=False)<EOL>comps = comps.astype('<STR_LIT>', copy=False)<EOL>f = lambda x, y: htable.ismember_int64(x, y)<EOL><DEDENT>except (TypeError, ValueError, OverflowError):<EOL><INDENT>values = values.astype(object)<EOL>comps = comps.astype(object)<EOL><DEDENT><DEDENT>elif is_float_dtype(comps):<EOL><INDENT>try:<EOL><INDENT>values = values.astype('<STR_LIT>', copy=False)<EOL>comps = comps.astype('<STR_LIT>', copy=False)<EOL>f = lambda x, y: htable.ismember_float64(x, y)<EOL><DEDENT>except (TypeError, ValueError):<EOL><INDENT>values = values.astype(object)<EOL>comps = comps.astype(object)<EOL><DEDENT><DEDENT>return f(comps, values)<EOL>
Compute the isin boolean array

Parameters
----------
comps : array-like
values : array-like

Returns
-------
boolean array same length as comps