Skip to content

Conversation

@ueshin
Copy link
Collaborator

@ueshin ueshin commented Mar 12, 2020

Adding support slice as rows_sel for iloc indexer.
E.g.,

>>> pdf = pd.DataFrame({'a':list('abcdefghij')})
>>> pdf
   a
0  a
1  b
2  c
3  d
4  e
5  f
6  g
7  h
8  i
9  j
>>> pdf.iloc[2:5]
   a
2  c
3  d
4  e
>>> pdf.iloc[2:-3]
   a
2  c
3  d
4  e
5  f
6  g
>>> pdf.iloc[-8:-3]
   a
2  c
3  d
4  e
5  f
6  g
>>> pdf.iloc[2:-3:2]
   a
2  c
4  e
6  g
>>> pdf.iloc[5:]
   a
5  f
6  g
7  h
8  i
9  j
>>> pdf.iloc[5:2]
Empty DataFrame
Columns: [a]
Index: []

Resolves #1230

@ueshin ueshin requested a review from HyukjinKwon March 12, 2020 00:36
@HyukjinKwon HyukjinKwon merged commit e4e5a1c into databricks:master Mar 12, 2020
@ueshin ueshin deleted the iloc branch March 12, 2020 02:05
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 slice as rows_sel for iloc indexer.

2 participants