# pandas.DataFrame.isin¶

DataFrame.isin(values)

Return boolean DataFrame showing whether each element in the DataFrame is contained in values.

Parameters: values : iterable, Series, DataFrame or dictionary 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 dictionary, the keys must be the column names, which must match. If values is a DataFrame, then both the index and column labels must match. DataFrame of booleans

Examples

When values is a list:

```>>> df = DataFrame({'A': [1, 2, 3], 'B': ['a', 'b', 'f']})
>>> df.isin([1, 3, 12, 'a'])
A      B
0   True   True
1  False  False
2   True  False
```

When values is a dict:

```>>> df = DataFrame({'A': [1, 2, 3], 'B': [1, 4, 7]})
>>> df.isin({'A': [1, 3], 'B': [4, 7, 12]})
A      B
0   True  False  # Note that B didn't match the 1 here.
1  False   True
2   True   True
```

When values is a Series or DataFrame:

```>>> df = DataFrame({'A': [1, 2, 3], 'B': ['a', 'b', 'f']})
>>> other = DataFrame({'A': [1, 3, 3, 2], 'B': ['e', 'f', 'f', 'e']})
>>> df.isin(other)
A      B
0   True  False
1  False  False  # Column A in `other` has a 3, but not at index 1.
2   True   True
```
{"ft_lang_label":"__label__en","ft_lang_prob":0.53575724,"math_prob":0.9774714,"size":1146,"snap":"2021-43-2021-49","text_gpt3_token_len":376,"char_repetition_ratio":0.17950962,"word_repetition_ratio":0.114285715,"special_character_ratio":0.38219896,"punctuation_ratio":0.23297492,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.99658465,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-12-01T22:20:46Z\",\"WARC-Record-ID\":\"<urn:uuid:fa149bce-c616-492d-9cbd-f141663dbdc7>\",\"Content-Length\":\"20279\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:6e9558d4-154f-45b5-888c-74700796a032>\",\"WARC-Concurrent-To\":\"<urn:uuid:49712a06-31d1-4c80-9f64-d7582d1ac967>\",\"WARC-IP-Address\":\"104.26.1.204\",\"WARC-Target-URI\":\"https://pandas.pydata.org/pandas-docs/version/0.18.0/generated/pandas.DataFrame.isin.html\",\"WARC-Payload-Digest\":\"sha1:BLUPX2ZNS242MC4OQIAASGFIM2YADZPD\",\"WARC-Block-Digest\":\"sha1:TZLGL2BNRAW6BI7TKCUHN7VXO3HA6XHM\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-49/CC-MAIN-2021-49_segments_1637964360951.9_warc_CC-MAIN-20211201203843-20211201233843-00442.warc.gz\"}"}