-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
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
ENH: add suffixes argument to compare #44365
ENH: add suffixes argument to compare #44365
Conversation
erfannariman
commented
Nov 9, 2021
- closes ENH: add suffixes argument to DataFrame.compare #44354
- tests added / passed
- Ensure all linting tests pass, see here for how to run them
- whatsnew entry
suffixes = ["left", "right"] | ||
comp = df1.compare(df2, suffixes=suffixes) | ||
|
||
result_suffixes = comp.columns.get_level_values(1).unique() |
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.
can you use tm.assert_frame_equal here to assert the results
@@ -8532,7 +8533,7 @@ def compare( | |||
else: | |||
axis = self._get_axis_number(align_axis) | |||
|
|||
diff = concat([self, other], axis=axis, keys=keys) | |||
diff = concat([self, other], axis=axis, keys=suffixes) |
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.
these must be a tuple and non-None right? can you add a check and tests the cases (e.g. this is similar to what we checkin merge for example)
@@ -7246,12 +7246,14 @@ def compare( | |||
align_axis: Axis = 1, | |||
keep_shape: bool = False, | |||
keep_equal: bool = False, | |||
suffixes: Suffixes = ("self", "other"), |
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.
pls update doc string & add a versionadded.
if we have this in the docs anywhere else (i don't think so but pls check), maybe needs updating
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.
can you update the doc-string, needs a versionadded 1.4. tag
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.
also add a note in other enhancements section for 1.4
@@ -7246,12 +7246,14 @@ def compare( | |||
align_axis: Axis = 1, | |||
keep_shape: bool = False, | |||
keep_equal: bool = False, | |||
suffixes: Suffixes = ("self", "other"), |
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.
can you update the doc-string, needs a versionadded 1.4. tag
This pull request is stale because it has been open for thirty days with no activity. Please update or respond to this comment if you're still interested in working on this. |
Thanks for the pull request, but this pull request appears to have gone stale. If interested in continuing, please merge in main and address the comments and this PR can be reopened. Closing in the meantime |