Pandas Series: isin() function

Find values contained in Pandas series

The isin() function is used to check whether values are contained in Series.

Return a boolean Series showing whether each element in the Series matches an element in the passed sequence of values exactly.


Series.isin(self, values)
Pandas Series isin image


Name Description Type/Default Value Required / Optional
values 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.
New in version 0.18.1: Support for values as a set.
set or list-like Required

Returns: Series
Series of booleans indicating if each element is in values.

Raises: TypeError
If values is a string


Download the Pandas Series Notebooks from here.

Previous: Row label of the minimum value in Pandas series
Next: Subsetting final periods of time in Pandas series

Share this Tutorial / Exercise on : Facebook and Twitter