Series.isin(values)
[source]
Return a boolean Series
showing whether each element in the Series
is exactly contained in the passed sequence of values
.
Parameters: |
values : set or list-like The sequence of values to test. Passing in a single string will raise a New in version 0.18.1. Support for values as a set |
---|---|
Returns: |
isin : Series (bool dtype) |
Raises: |
TypeError
|
See also
>>> s = pd.Series(list('abc')) >>> s.isin(['a', 'c', 'e']) 0 True 1 False 2 True dtype: bool
Passing a single string as s.isin('a')
will raise an error. Use a list of one element instead:
>>> s.isin(['a']) 0 True 1 False 2 False dtype: bool
© 2011–2012 Lambda Foundry, Inc. and PyData Development Team
© 2008–2011 AQR Capital Management, LLC
© 2008–2014 the pandas development team
Licensed under the 3-clause BSD License.
http://pandas.pydata.org/pandas-docs/version/0.19.2/generated/pandas.Series.isin.html