-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Bug: DataFrame.clip fixed for lower > upper #52365
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
* Before when lower > upper arguments were swapped, changed to be consistent with numpy, all equal to upper * test added
* DataFrame.clip fixed for lower > upper with list-like arguments
Looks like some tests are failing after merging in main branch. I will look at this. |
I personally think raising is the most informative behavior, but open to thoughts from other core team members |
It is worth mentioning that Another similar example from pandas api, |
|
Ok, so I guess we also need to change I am not sure which exception it should raise, some existing pandas exception? I guess |
I have started implementation and I think there is too much to make validation for scalars, lists and DataFrame arguments. So if you insist on doing this, I can close this PR and unassign from issue. |
I would suggest closing this PR now until there is some consensus on the main issue on how to handle this scenario |
Thanks for the PR, but I think this scenario needs a little more discussion before moving forward so closing |
Fixed behavior of DataFrame.clip for
lower
>upper
arguments. Changed to be consistent with numpy - all equal toupper
. Main reason of bug was undocumented swap of arguments for scalars and for list-like arguments comparison with initial DataFrame for both bounds.doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.