-
-
Notifications
You must be signed in to change notification settings - Fork 18k
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
API: Series.str.match == extract? #5075
Comments
Actually, that should say Extract does NaN, not None, so that entry will become NaN with this edit. IMO we should leave *Am I doing it right, @hayd? |
is there a reason to not make |
I merged #5099 |
That makes sense to me. |
ok...why don't you do a PR to put that deprecation in (also I think you changed the docs in basics.rst, not just in v0.13.0 (#5099) |
@jtratner brings up a good point..... is there a different in will it break compat if we just call |
@jtratner questions but if you can use the output of extract with match, then I don't see the point of breaking backwards compatibility by scuttling the old name could you previously do something like:
and will that stop working now? @hayd @danielballan can you comment on this? |
Although match kinda == extract, I much prefer the name extract (as that describes more precisely what it's going on... pandorable), and I think it's ok to be consistent with re but match is vague... I agree current output IS kinda not that useful. The bool thing for groupless is an interesting idea (and would distinguish extract and match), and seems "expected" (that's what "match" means in English!). Also if the output NaN instead of [] for missing that would be better.
atm using
|
okay. I was just hoping we could not add a method then deprecate an old one if we could just put it together under one method. |
At the moment what is the best way to match an entire regex? I guess you can use...
I can't think of another reason to use match, so if there's another way to do the above (and I expect there is) then I think am happy to depreciate match... (but -1 on renaming extract to match!). |
so why don't you
and then match is just a wrapper around extract (or can just remove it and point to extract)? |
@hayd I think it's worth it to have a way to convert a Series of strings into a boolean indexer (which you might use for filter, but you could also use for, e.g., making an indexer to use with something else). @jreback I'd like to add extract, and turn match into something that converts str --> bool (and I guess leaves nan?), because I think that's much clearer. No reason to overload extract. (so basically sugar for |
what was decided here? |
Let's add extract and then I'll put in a PR to change match to turn into a |
ok...you could deprecate match in 0.13 (and just direct to using the kw with extract)..... |
Yeah, that's what I'm thinking, maybe something like bool_only = False and
|
|
I took a stab at it. See #5224. |
This is the whatsnew example. I think for compat, the 3rd entry should be
(np.nan, 3)
?The text was updated successfully, but these errors were encountered: