-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Incorrect identically-labeled DataFrame objects Exception comes with df.compare method #50083 #50287
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
tpackard1
commented
Dec 15, 2022
- closes Incorrect identically-labeled DataFrame objects Exception comes with df.compare method #50083
- All code checks passed
First time contributing to the code base and hopefully everything goes smoothly. |
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.
this is a nice start! could you also:
- fixup the failing tests
- add a whatsnew note
I will try to fix the failing tests tonight. |
07b5776
to
ce8637a
Compare
@MarcoGorelli would the following work as a whatsnew note?
Edit: sorry for all the commits please see the most recent one with the message "fixed formatting"; if you would like I will try to get rid of the two before the last |
You can just say that you improved the error message - I think there's some similar entries in the what's new file No need to mention tests, it's a user facing note |
d76bcea
to
50fb526
Compare
@MarcoGorelli I have updated the whats new file. Please review whenever you have a moment |
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.
Looks good, just got a minor comment on the whatsnew note
doc/source/whatsnew/v2.0.0.rst
Outdated
@@ -97,6 +97,7 @@ Other enhancements | |||
- Added :meth:`Index.infer_objects` analogous to :meth:`Series.infer_objects` (:issue:`50034`) | |||
- Added ``copy`` parameter to :meth:`Series.infer_objects` and :meth:`DataFrame.infer_objects`, passing ``False`` will avoid making copies for series or columns that are already non-object or where no better dtype can be inferred (:issue:`50096`) | |||
- :meth:`DataFrame.plot.hist` now recognizes ``xlabel`` and ``ylabel`` arguments (:issue:`49793`) | |||
- :func:`DataFrame.compare` exception message thrown improved to include that both index and columns that are identically labeled can be compared. (:issue:`50083`) |
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.
- :func:`DataFrame.compare` exception message thrown improved to include that both index and columns that are identically labeled can be compared. (:issue:`50083`) | |
- Improved error message in :func:`DataFrame.compare` to clarify that "identically labelled" refers to both index and columns (:issue:`50083`) |
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.
I updated the whatsnew note to match your comment above
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.
Wait, something went wrong when merging/rebasing I presume, you've lost all your changes, all I can see if the whatsnew note change
50fb526
to
ef1ec22
Compare
I have updated the whatsnew comment and added back in the all the other changes. I wanted to make sure all the checks were passed before requesting a review but some of the checks keep failing with the following error message |
Hey - CI failures are unrelated, they're showing up in other PRs, I'll see what's going on there |
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.
one last minor comment, sorry - then I think it's good to go 🚀
doc/source/whatsnew/v2.0.0.rst
Outdated
@@ -98,6 +98,7 @@ Other enhancements | |||
- Added :meth:`Index.infer_objects` analogous to :meth:`Series.infer_objects` (:issue:`50034`) | |||
- Added ``copy`` parameter to :meth:`Series.infer_objects` and :meth:`DataFrame.infer_objects`, passing ``False`` will avoid making copies for series or columns that are already non-object or where no better dtype can be inferred (:issue:`50096`) | |||
- :meth:`DataFrame.plot.hist` now recognizes ``xlabel`` and ``ylabel`` arguments (:issue:`49793`) | |||
- Improved error message in :func:`DataFrame.compare` to clarify that "identically labelled" refers to both index and columns (:issue:`50083`) |
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.
sorry, just noticed that this affects much more than just compare
, e.g:
In [8]: df == dfother
---------------------------------------------------------------------------
ValueError: Can only compare identically-labeled DataFrame objects
would also have thrown this error
let's rephrase as
Improved error message when trying to align :class:`DataFrame` objects (for example, in :func:`DataFrame.compare`) to clarify ...
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.
Looks good to me, thanks @tpackard1
Thanks @tpackard1 |