-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: Unexpected keyword argument maxsplit
on rsplit
even though it is accepted in vanilla Python
#47423
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
Comments
Hey @paw-lu The parameter rpslit does accept (
Another difference is that
I'm not sure it's worth going through a deprecation cycle to introduce i.e. to disallow
in favour of
This would require using the (apologies for closing, was an accident, I reopened straight away) |
Completeley missed both of these! Didn't know the Pandas implimentation had drifted from the standard library like this.
Yeah now that I know some of the context (thanks btw) I agree with you.
Good idea here. I agree on this one too. I can take responsibility for implimenting this—but it will be a while until I get to it! It's all good if someone beats me to it! |
Cool - if anyone wants to take this on, here's a similar PR you can use as an example https://github.com/pandas-dev/pandas/pull/41699/files |
Hi, Can I take on me? :) |
Yeah go ahead |
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
When using
pd.Series.str.rsplit
in Pandas, the accepted kwargs are inconsistent with Python's.Python's
str.rsplit
accepts the kwargmaxsplit=
, while Panda'spd.Series.str.rsplit
does not.Expected Behavior
I expect Panda's
pd.Series.str.rsplit
to behave identically to Python'sstr.rsplit
, this includes accepting the same kwargs, namelymaxsplit=
in this case.Installed Versions
pd.show_versions()
The text was updated successfully, but these errors were encountered: