Skip to content

ENH: str extract with default value #38003

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 12 commits into from
Closed

ENH: str extract with default value #38003

wants to merge 12 commits into from

Conversation

erfannariman
Copy link
Member

@erfannariman erfannariman commented Nov 22, 2020

@pep8speaks
Copy link

pep8speaks commented Nov 22, 2020

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-05-10 09:42:30 UTC

@erfannariman
Copy link
Member Author

@jreback any chance we can decide what we want to do with this PR? If you think this change is not needed, It's fine for me to close it.

@jreback
Copy link
Contributor

jreback commented Dec 21, 2020

i'd really like a real-world usecase of this. The work-aroudn is actually very simpler (even simpler that what you posted), so not convinced this all that useful. that said prob doesnt' hurt.

@erfannariman yeah i guess this is ok, can't hurt. rename default -> fill_value (as that is the term we use else where) and move the note to 1.3.

@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 Jan 22, 2021
@datapythonista
Copy link
Member

@erfannariman closing this, if you think of a real case for this, happy to reopen. But agree with Jeff that even if this makes sense, adding more complexity to pandas for a reasonable use case that no user may ever face, it's not worth

@simonjayhawkins
Copy link
Member

@erfannariman closing this, if you think of a real case for this, happy to reopen. But agree with Jeff that even if this makes sense, adding more complexity to pandas for a reasonable use case that no user may ever face, it's not worth

technically it's probably straightforward, we already pass na in other methods and handle it in the wrap_result and _str_map methods (as na_value)

i'm not sure a real world case is required to justify this as accepting a na parameter would make str.extract consistent with other str accessor methods.

@simonjayhawkins simonjayhawkins added the Strings String extension data type and string data label May 10, 2021
@simonjayhawkins
Copy link
Member

I'll reopen this, but I think this enhancement should wait until after str.extract is dispatched to array and the _wrap_result and str_map methods are re-used. #41372

@simonjayhawkins
Copy link
Member

@erfannariman can you resolve conflicts and can take another look

@simonjayhawkins
Copy link
Member

@erfannariman closing as stale. ping if you want to pick this up again.

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 default value to str.extract
5 participants