bigframes.geopandas.GeoSeries.isin#
- GeoSeries.isin(values) Series#
Whether elements in Series are contained in values.
Return a boolean Series showing whether each element in the Series matches an element in the passed sequence of values exactly.
Note
This function treats all NaN-like values(e.g., pd.NA, numpy.nan, None) as the same. That is, if any form of NaN is present in values, all forms of NaN in the series will be considered a match. (though pandas may not)
Examples:
>>> s = bpd.Series(['llama', 'cow', 'llama', 'beetle', 'llama', ... 'hippo'], name='animal') >>> s 0 llama 1 cow 2 llama 3 beetle 4 llama 5 hippo Name: animal, dtype: string
To invert the boolean values, use the ~ operator:
>>> ~s.isin(['cow', 'llama']) 0 False 1 False 2 False 3 True 4 False 5 True Name: animal, dtype: boolean
Passing a single string as s.isin(‘llama’) will raise an error. Use a list of one element instead:
>>> s.isin(['llama']) 0 True 1 False 2 True 3 False 4 True 5 False Name: animal, dtype: boolean
Strings and integers are distinct and are therefore not comparable:
>>> bpd.Series([1]).isin(['1']) 0 False dtype: boolean >>> bpd.Series([1.1]).isin(['1.1']) 0 False dtype: boolean
- Parameters:
values (list-like) – The sequence of values to test. Passing in a single string will raise a TypeError. Instead, turn a single string into a list of one element.
- Returns:
Series of booleans indicating if each element is in values.
- Return type:
- Raises:
TypeError – If input is not list-like.