Skip to content

Make the documentation for pandas.Series.str.replace() clearer #31225

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

Closed
drkarthi opened this issue Jan 22, 2020 · 1 comment · Fixed by #32478
Closed

Make the documentation for pandas.Series.str.replace() clearer #31225

drkarthi opened this issue Jan 22, 2020 · 1 comment · Fixed by #32478
Assignees
Labels

Comments

@drkarthi
Copy link

Problem description

The current documentation of str.replace says Replace occurrences of pattern/regex in the Series/Index with some other string. Equivalent to str.replace() or re.sub()..

For the novice user this suggests that base Python's str.replace() and re.sub() provide equivalent functionality. My suggestion is to explicitly specify that this depends on the value of regex, making it clearer. Something like this:

Replace occurrences of pattern/regex in the Series/Index with some other string. Equivalent to str.replace() or re.sub() **depending on the _regex_ value**.

@ashwinpn
Copy link
Contributor

ashwinpn commented Mar 5, 2020

take

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants