-
Notifications
You must be signed in to change notification settings - Fork 358
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
Implemented intersection for Index & MultiIndex #1747
Conversation
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.
Actually I'd separate the function into ones for each class as there are so many if isinstance(self, MultiIndex): .. else: ..
.
Sounds good. I'll separate |
@ueshin , For #1747 (comment) and #1747 (comment), The comparison between empty empty_pandas_multi_index = pmidx.intersection(pidx) # MultiIndex([], )
empty_koalas_multi_index = ks.from_pandas(empty_pandas_multi_index) # MultiIndex([], )
self.assert_eq(empty_pandas_multi_index, empty_koalas_multi_index) The test above is failed with following error. AssertionError: MultiIndex level [0] are different
MultiIndex level [0] classes are not equivalent
[left]: Index([], dtype='object')
[right]: Float64Index([], dtype='float64')
Left:
MultiIndex([], )
object
Right:
MultiIndex([], )
object Maybe let me investigate this in the separated PR ? |
Codecov Report
@@ Coverage Diff @@
## master #1747 +/- ##
=======================================
Coverage 94.19% 94.20%
=======================================
Files 40 40
Lines 9867 9915 +48
=======================================
+ Hits 9294 9340 +46
- Misses 573 575 +2
Continue to review full report at Codecov.
|
The empty one would likely be an issue from Spark IIRC. |
This PR proposes the new API
Index.intersection()
andMultiIndex.intersection()
.