bigframes.pandas.DataFrame.isin#
- DataFrame.isin(values) DataFrame[source]#
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
valuesis 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
valuesis 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]
- Parameters:
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.
- Returns:
DataFrame of booleans showing whether each element in the DataFrame is contained in values.
- Return type:
- Raises:
TypeError – If values provided are not list-like objects.