Skip to content

Commit ea48bf0

Browse files
update example to animal-framework
1 parent 293cbc9 commit ea48bf0

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

pandas/core/series.py

+15-8
Original file line numberDiff line numberDiff line change
@@ -2777,21 +2777,28 @@ def isin(self, values):
27772777
Examples
27782778
--------
27792779
2780-
>>> s = pd.Series(list('abc'))
2781-
>>> s.isin(['a', 'c', 'e'])
2780+
>>> s = pd.Series(['lama', 'cow', 'lama', 'beetle', 'lama',
2781+
... 'hippo'], name='animal')
2782+
>>> s.isin(['cow', 'lama'])
27822783
0 True
2783-
1 False
2784+
1 True
27842785
2 True
2785-
dtype: bool
2786+
3 False
2787+
4 True
2788+
5 False
2789+
Name: animal, dtype: bool
27862790
2787-
Passing a single string as ``s.isin('a')`` will raise an error. Use
2791+
Passing a single string as ``s.isin('lama')`` will raise an error. Use
27882792
a list of one element instead:
27892793
2790-
>>> s.isin(['a'])
2794+
>>> s.isin(['lama'])
27912795
0 True
27922796
1 False
2793-
2 False
2794-
dtype: bool
2797+
2 True
2798+
3 False
2799+
4 True
2800+
5 False
2801+
Name: animal, dtype: bool
27952802
"""
27962803
result = algorithms.isin(com._values_from_object(self), values)
27972804
return self._constructor(result, index=self.index).__finalize__(self)

0 commit comments

Comments
 (0)