Skip to content

Commit c2b03e4

Browse files
mitchnegusjreback
authored andcommitted
clarifying regex pipe behavior (#21589)
1 parent bd1b04e commit c2b03e4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pandas/core/strings.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -335,11 +335,11 @@ def str_contains(arr, pat, case=True, flags=0, na=np.nan, regex=True):
335335
4 False
336336
dtype: bool
337337
338-
Returning 'house' and 'parrot' within same string.
338+
Returning 'house' or 'dog' when either expression occurs in a string.
339339
340-
>>> s1.str.contains('house|parrot', regex=True)
340+
>>> s1.str.contains('house|dog', regex=True)
341341
0 False
342-
1 False
342+
1 True
343343
2 True
344344
3 False
345345
4 NaN

0 commit comments

Comments
 (0)