-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
ENH - Index set operation modifications to address issue #23525 #23538
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
Merged
Merged
Changes from all commits
Commits
Show all changes
75 commits
Select commit
Hold shift + click to select a range
c2cf269
ENH - first pass at modifying set operations on indexes. Dont ignore …
sds9995 435e50f
Merge branch 'master' into enh/index_setops
sds9995 4922fd3
BUG - account for empty index + non-monotonic index, and dont try to …
sds9995 5e528a1
TST - update existing tests to account for cross type index joins bei…
sds9995 cdaa5b0
ENH - incompatibility checks and incompatible type unions
sds9995 40d57ec
TST - update datetime union tets, add tests for inconsistent unions
sds9995 11fd041
CLN - refactor union -> _union
sds9995 8f0ace3
TST - add tests for categrorical index, and compatible inconsistent p…
sds9995 8364c2e
BUG - union -> _union in overriden _union methods
sds9995 ab329a9
TST - update test_operator raised exception
sds9995 93486ad
CLN - pep8 line adherence
sds9995 e435e4c
ENH - reverse polarity of compatibility check and add docstrings
sds9995 b9787b8
Merge branch 'master' into enh/index_setops
sds9995 2241b65
TST - add test fixture for index factories and use in test_setops
sds9995 4daf360
ENH - cast difference result to original dtype to match other index b…
sds9995 6e5a52b
TST - update interval setop test to account for difference now return…
sds9995 d344e11
CLN - remove unnecceary code from test
sds9995 b339bd1
CLN - reorganize some code to make it more readable
sds9995 85e2db7
CLN - pep8 adherence
sds9995 cf34960
CLN - pep8 adherence
sds9995 7150c22
BUG - fix function name
sds9995 fbb3743
Merge branch 'master' into enh/index_setops
sds9995 5aa41f6
BUG - fix numeric index compatibility
sds9995 02d7a3b
BUG - actually fix numeric compatibilty check, with passing index tests
sds9995 558e182
DOC - initial whatsnew
sds9995 706f973
ENH - no longer consider category indexes containing different catego…
sds9995 2ccab59
TST/CLN - no longer need new index_factory fixture and make code more…
sds9995 c70f1c0
CLN - make code more readable
sds9995 edb7e9c
CLN - pep8 adherence
sds9995 84bfbda
Merge branch 'master' into enh/index_setops
sds9995 aba75fe
DOC - fix whatsnew entry
sds9995 fc9f138
BUG - chagne object dtype index construction
sds9995 69cce99
Merge branch 'master' into enh/index_setops
sds9995 fdfc7d7
CLN/BUG - clean according to failed pandas-dev style checks
sds9995 42ca70e
CLN - fix imports with isort
sds9995 5b25645
CLN - refactor tests and remove overriden public union methods
sds9995 9b1ee7f
Merge branch 'master' into enh/index_setops
sds9995 fdf9b71
CLN - make code more efficient and cleanup whatsnew
sds9995 1de3cc8
Merge branch 'master' into enh/index_setops
sds9995 8ed1093
DOC - fix ipython code block
sds9995 77ca3a3
DOC - fix whatsnew code blocks again
sds9995 5921038
CLN - clean up some code, tests and docs
sds9995 3b94e3b
CLN - reorganize some code and add TODOs
sds9995 fd4510e
CLN - remove trailing whitespace
ms7463 345eec1
Merge branch 'master' into enh/index_setops
sds9995 265a7ee
Merge branch 'enh/index_setops' of https://github.com/ArtinSarraf/pan…
sds9995 5de3d57
CLN - fix import order
sds9995 6d82621
CLN - code cleanup, remove unneccesary operations
sds9995 0af8a24
Merge branch 'master' into enh/index_setops
sds9995 5a87715
CLN - apply error messages to both statements
sds9995 a4f9e78
TST - add regex queries
sds9995 c3c0caa
Merge branch 'master' into enh/index_setops
sds9995 0bcbdf4
BUG - fix default sort arg
sds9995 c410625
BUG - remove print
sds9995 6bb054f
TST/DOC - move to new whatsnew and use local fixture for tests
sds9995 aea731c
DOC - minor update to get tests to rerun
ms7463 b5938fc
Merge branch 'master' into enh/index_setops
sds9995 25452fc
Merge branch 'enh/index_setops' of https://github.com/ArtinSarraf/pan…
sds9995 0b97a79
Merge branch 'master' into enh/index_setops
ms7463 bf11c6f
Merge branch 'master' into enh/index_setops
sds9995 6fd941d
Merge branch 'enh/index_setops' of https://github.com/ArtinSarraf/pan…
sds9995 32037b5
DOC - fix docstrings and whatsnew
sds9995 8870006
Merge branch 'master' into enh/index_setops
sds9995 1d12bc9
DOC - update docstring
sds9995 92f6707
TST - use tm.assert_index_equal
sds9995 fbf3242
Merge branch 'master' into enh/index_setops
sds9995 38d9f74
TST - parametrize union tests
sds9995 b9e7b18
Merge branch 'master' into enh/index_setops
sds9995 69aaa93
DOC - add docstring
sds9995 b57160a
Merge branch 'master' into enh/index_setops
sds9995 daa1287
Merge branch 'master' into enh/index_setops
sds9995 54898c1
CLN/TST - fix super method calls and add error msg
sds9995 fa839a9
TST - add Timestamp to regexand fix import sorting
sds9995 a36f475
CLN - minor style updates
sds9995 b840f49
Merge branch 'master' into enh/index_setops
sds9995 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -470,7 +470,7 @@ def _extended_gcd(self, a, b): | |
old_t, t = t, old_t - quotient * t | ||
return old_r, old_s, old_t | ||
|
||
def union(self, other, sort=None): | ||
def _union(self, other, sort): | ||
""" | ||
Form the union of two Index objects and sorts if possible | ||
|
||
|
@@ -490,9 +490,8 @@ def union(self, other, sort=None): | |
------- | ||
union : Index | ||
""" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this needed any longer? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see related comment in DatetimeIndex module |
||
self._assert_can_do_setop(other) | ||
if len(other) == 0 or self.equals(other) or len(self) == 0: | ||
return super().union(other, sort=sort) | ||
if not len(other) or self.equals(other) or not len(self): | ||
return super()._union(other, sort=sort) | ||
|
||
if isinstance(other, RangeIndex) and sort is None: | ||
start_s, step_s = self._start, self._step | ||
|
@@ -530,8 +529,7 @@ def union(self, other, sort=None): | |
(start_s + step_o >= start_o) and | ||
(end_s - step_o <= end_o)): | ||
return RangeIndex(start_r, end_r + step_o, step_o) | ||
|
||
return self._int64index.union(other, sort=sort) | ||
return self._int64index._union(other, sort=sort) | ||
|
||
@Appender(_index_shared_docs['join']) | ||
def join(self, other, how='left', level=None, return_indexers=False, | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.