-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
ENH: Improve perf of str_extract #5944
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
Conversation
|
pls add a note in release notes (u can ref this PR) |
@@ -449,31 +448,27 @@ def f(x): | |||
return None | |||
m = regex.search(x) | |||
if m: | |||
return m.groups()[0] # may be None | |||
return m.groups()[0] or np.nan |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
m.groups()[0]
might return ''. Only None should be turned into NaN. I'll fix this when I get back.
Always glad to see 10x. tx. |
@unutbu ready for merge? |
@jreback: Yes, ready. |
ENH: Improve perf of str_extract
thanks! |
Building the result from a list of strings or a list of lists seems to improve performance over building the result via
arr.apply(f)
.