We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Found this while trying to clean up axis handling in core.generic
This fails as you would hope
>>> df = pd.DataFrame([[1]]) >>> df.rename({0: 1}, columns={0: 2}, axis=1) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/williamayd/clones/pandas/pandas/util/_decorators.py", line 235, in wrapper return func(*args, **kwargs) File "/Users/williamayd/clones/pandas/pandas/core/frame.py", line 4143, in rename axes = validate_axis_style_args(self, args, kwargs, "mapper", "rename") File "/Users/williamayd/clones/pandas/pandas/util/_validators.py", line 287, in validate_axis_style_args raise TypeError(msg) TypeError: Cannot specify both 'axis' and any of 'index' or 'columns'.
This doesn't
>>> df.rename({0: 1}, index={0: 2}) 0 1 1
And perhaps even more surprising is that you will get a different result depending on whether the first argument is passed by position or keyword
>>> df.rename(mapper={0: 1}, index={0: 2}) 0 2 1
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Found this while trying to clean up axis handling in core.generic
This fails as you would hope
This doesn't
And perhaps even more surprising is that you will get a different result depending on whether the first argument is passed by position or keyword
The text was updated successfully, but these errors were encountered: