| [ Web Proxy ] |
| Viewing: https://dataframes.bigquery.dev/reference/api/bigframes.pandas.DataFrame.isin.html | [Back] [Original] |
Section Navigation
Whether each element in the DataFrame is contained in values.
Examples:
>>> df = bpd.DataFrame({'num_legs': [2, 4], 'num_wings': [2, 0]},
... index=['falcon', 'dog'])
>>> df
num_legs num_wings
falcon 2 2
dog 4 0
[2 rows x 2 columns]
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
[2 rows x 2 columns]
When values is a dict, we can pass it to check for each column separately:
>>> df.isin({'num_wings': [0, 3]})
num_legs num_wings
falcon False False
dog False True
[2 rows x 2 columns]
values (iterable, or dict) The result will only be true at a location if all the labels match. If values is a dict, the keys must be the column names, which must match.
DataFrame of booleans showing whether each element in the DataFrame is contained in values.
TypeError If values provided are not list-like objects.
Copyright 2019, Google.
Created using Sphinx 8.1.3.
Built with the PyData Sphinx Theme 0.19.0.
| Web Proxy Viewer | New URL | Original Page |