8000 ENH: Allow literal (non-regex) replacement using .str.replace #16808 by Liam3851 · Pull Request #19584 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

ENH: Allow literal (non-regex) replacement using .str.replace #16808 #19584

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Feb 28, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
move Raises
  • Loading branch information
jreback committed Feb 28, 2018
commit f2198b092f7f005571d67bf301dedfc9ffbf04dd
13 changes: 7 additions & 6 deletions pandas/core/strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,13 @@ def str_replace(arr, pat, repl, n=-1, case=None, flags=0, regex=True):
-------
replaced : Series/Index of objects

Raises
------
ValueError
* if `regex` is False and `repl` is a callable or `pat` is a compiled
regex
* if `pat` is a compiled regex and `case` or `flags` is set

Notes
-----
When `pat` is a compiled regex, all flags should be included in the
Expand Down Expand Up @@ -415,12 +422,6 @@ def str_replace(arr, pat, repl, n=-1, case=None, flags=0, regex=True):
2 NaN
dtype: object

Raises
------
ValueError
* if `regex` is False and `repl` is a callable or `pat` is a compiled
regex
* if `pat` is a compiled regex and `case` or `flags` is set
"""

# Check whether repl is valid (GH 13438, GH 15055)
Expand Down
0