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_wingsfalcon 2 2dog 4 0[2 rows x 2 columns]
When
valuesis a list check whether every value in the DataFrame ispresent in the list (which animals have 0 or 2 legs or wings).>>>df.isin([0,2]) num_legs num_wingsfalcon True Truedog 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_wingsfalcon False Falsedog False True[2 rows x 2 columns]
- Parameters:
values (iterable, ordict) – The result will only be true at a location if all thelabels match. Ifvalues is a dict, the keys must bethe column names, which must match.
- Returns:
DataFrame of booleans showing whether each elementin the DataFrame is contained in values.
- Return type:
- Raises:
TypeError – If values provided are not list-like objects.
On this page