-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
PERF: Merge empty frame #45838
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
PERF: Merge empty frame #45838
Conversation
asv_bench/benchmarks/join_merge.py
Outdated
@@ -216,6 +216,9 @@ def time_merge_dataframe_integer_2key(self, sort): | |||
def time_merge_dataframe_integer_key(self, sort): | |||
merge(self.df, self.df2, on="key1", sort=sort) | |||
|
|||
def time_merge_dataframe_empty(self, sort): |
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 add the reverse as well (e.g. left empty)
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.
reverse added here
doc/source/whatsnew/v1.5.0.rst
Outdated
@@ -206,6 +206,7 @@ Performance improvements | |||
- Performance improvement in :meth:`DataFrame.duplicated` when subset consists of only one column (:issue:`45236`) | |||
- Performance improvement in :meth:`.GroupBy.transform` when broadcasting values for user-defined functions (:issue:`45708`) | |||
- Performance improvement in :meth:`.GroupBy.transform` for user-defined functions when only a single group exists (:issue:`44977`) | |||
- Performance improvement in :meth:`DataFrame.merge` when left and/or right are empty (:issue:`45838`) |
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 think we normally use :func: merge instead of DataFrame.merge?
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.
updated to :func: merge. thanks
lgtm will merge on green. tip to avoid conflicts in the release notes; add a note not at the bottom, add in middle somewhere |
Greenish |
Thx @lukemanley |
* faster merge with empty frame * whatsnew * docs, tests, asvs * fix whatsnew Co-authored-by: Jeff Reback <[email protected]>
* faster merge with empty frame * whatsnew * docs, tests, asvs * fix whatsnew Co-authored-by: Jeff Reback <[email protected]>
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.Faster merge when left or right is empty.
One ASV added:
Some additional examples: