Skip to content

Conversation

@ueshin
Copy link
Collaborator

@ueshin ueshin commented Mar 13, 2020

Adding support MultiIndex for loc indexer with slice as row_sel.

E.g.,

>>> pser
x  a    1
   b    2
y  c    3
   d    4
z  e    5
dtype: int64
>>> pser.loc['y':]
y  c    3
   d    4
z  e    5
dtype: int64
>>> pser.loc[:'y']
x  a    1
   b    2
y  c    3
   d    4
dtype: int64
>>> pser.loc[('x','b'):]
x  b    2
y  c    3
   d    4
z  e    5
dtype: int64
>>> pser.loc[:('y','c')]
x  a    1
   b    2
y  c    3
dtype: int64
>>> pser.loc[('x','b'):('y','c')]
x  b    2
y  c    3
dtype: int64
>>> pser.loc['x':('y','c')]
x  a    1
   b    2
y  c    3
dtype: int64
>>> pser.loc[('x','b'):'y']
x  b    2
y  c    3
   d    4
dtype: int64

Resolves #1175, Closes #1182.

@ueshin ueshin requested a review from HyukjinKwon March 13, 2020 22:35
@ueshin
Copy link
Collaborator Author

ueshin commented Mar 13, 2020

also cc @itholic

@codecov-io
Copy link

Codecov Report

Merging #1344 into master will decrease coverage by 0.03%.
The diff coverage is 89.09%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #1344      +/-   ##
=========================================
- Coverage   95.23%   95.2%   -0.04%     
=========================================
  Files          34      34              
  Lines        7538    7574      +36     
=========================================
+ Hits         7179    7211      +32     
- Misses        359     363       +4
Impacted Files Coverage Δ
databricks/koalas/indexes.py 96.55% <85%> (+0.02%) ⬆️
databricks/koalas/indexing.py 94.31% <91.42%> (-0.52%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b248a21...97e10aa. Read the comment docs.

Copy link
Member

@HyukjinKwon HyukjinKwon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't taken a close look yet but seems good.

@HyukjinKwon HyukjinKwon merged commit 5aa97c6 into databricks:master Mar 17, 2020
@itholic
Copy link
Contributor

itholic commented Mar 17, 2020

Looks fine to me, either. 👍

return tuple(result)

@staticmethod
def _comparator_for_monotonic_increasing(data_type):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is cool

@ueshin ueshin deleted the loc branch March 17, 2020 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support MultiIndex for loc indexer with slice as row_sel.

4 participants