Skip to content

ENH: add str.removeprefix #39226

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
wants to merge 24 commits into from
Closed

ENH: add str.removeprefix #39226

wants to merge 24 commits into from

Conversation

erfannariman
Copy link
Member

@erfannariman erfannariman commented Jan 17, 2021

@erfannariman erfannariman changed the title 36944 add removeprefix ENH: add str.removeprefix Jan 17, 2021
@pep8speaks
Copy link

pep8speaks commented Jan 17, 2021

Hello @erfannariman! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2021-02-12 22:46:27 UTC

@jreback jreback added the Strings String extension data type and string data label Jan 20, 2021
@erfannariman erfannariman requested a review from jreback January 26, 2021 13:15
@jreback
Copy link
Contributor

jreback commented Feb 11, 2021

@erfannariman can you merge master and fixup

@erfannariman
Copy link
Member Author

@erfannariman can you merge master and fixup

Yes, will do this weekend.

@WillAyd
Copy link
Member

WillAyd commented Feb 16, 2021

Will also want to add an entry to doc/source/reference/series.rst to make sure this renders in the docs

@jreback
Copy link
Contributor

jreback commented Feb 16, 2021

yep, pls add to here: https://pandas.pydata.org/pandas-docs/dev/user_guide/text.html#method-summary, optionally add add an example near strip

@github-actions
Copy link
Contributor

This pull request is stale because it has been open for thirty days with no activity. Please update or respond to this comment if you're still interested in working on this.

@github-actions github-actions bot added the Stale label Mar 19, 2021
@simonjayhawkins
Copy link
Member

@erfannariman can you merge master and get tests to pass. also can you add a benchmark.

Is there a benefit to using the builtin if py39 else using the fallback

and also for the fallback is there any benefit to having two maps followed by a np.where over just using the fallback function (len(prefix) is invariant so the mapper function can be defined in a closure)

This does not close the issue? need to add removesuffix also?

This should also work for StringArray. can you use any_string_dtype in the tests

@simonjayhawkins
Copy link
Member

Thanks @erfannariman for the PR. closing as stale. ping if you want to continue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Stale Strings String extension data type and string data
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ENH: add string method remove prefix and suffix, python 3.9
5 participants