Skip to content

Commit

Permalink
TST: Escape invalid escape characters (#21154)
Browse files Browse the repository at this point in the history
Partially addresses gh-21137.
  • Loading branch information
gfyoung authored and jreback committed May 21, 2018
1 parent 81358e8 commit ac32ce8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pandas/core/strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def str_count(arr, pat, flags=0):
Escape ``'$'`` to find the literal dollar sign.
>>> s = pd.Series(['$', 'B', 'Aab$', '$$ca', 'C$B$', 'cat'])
>>> s.str.count('\$')
>>> s.str.count('\\$')
0 1
1 0
2 1
Expand Down Expand Up @@ -358,7 +358,7 @@ def str_contains(arr, pat, case=True, flags=0, na=np.nan, regex=True):
Returning any digit using regular expression.
>>> s1.str.contains('\d', regex=True)
>>> s1.str.contains('\\d', regex=True)
0 False
1 False
2 False
Expand Down

0 comments on commit ac32ce8

Please sign in to comment.