Skip to content

Conversation

@HyukjinKwon
Copy link
Member

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

>>> pdf = pd.DataFrame({'a':list('abcdefghij'), 'b':list('abcdefghij')})
>>> pdf.iloc[[-1, 1, 2,3]]
   a  b
9  j  j
1  b  b
2  c  c
3  d  d
>>> pdf.iloc[[-1, 1, 2,3], :]
   a  b
9  j  j
1  b  b
2  c  c
3  d  d
>>> pdf.iloc[[-1, 1, 2,3], :1]
   a
9  j
1  b
2  c
3  d
>>> pdf.iloc[[]]
Empty DataFrame
Columns: [a, b]
Index: []

Resolve #556

- A list or array of integers for column selection, e.g. ``[4, 3, 0]``.
- A boolean array for column selection.
- A slice object with ints for column selection, e.g. ``1:7``.
- A slice object with ints without start and step for row selection, e.g. ``:7``.
Copy link
Member Author

Choose a reason for hiding this comment

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

It was fixed at #1335

Copy link
Collaborator

@ueshin ueshin left a comment

Choose a reason for hiding this comment

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

LGTM.

@codecov-io
Copy link

codecov-io commented Mar 13, 2020

Codecov Report

Merging #1338 into master will decrease coverage by 0.02%.
The diff coverage is 95.65%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1338      +/-   ##
==========================================
- Coverage   95.24%   95.22%   -0.03%     
==========================================
  Files          34       34              
  Lines        7489     7511      +22     
==========================================
+ Hits         7133     7152      +19     
- Misses        356      359       +3     
Impacted Files Coverage Δ
databricks/koalas/indexing.py 94.82% <95.65%> (-0.47%) ⬇️

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 2471502...1acf6c8. Read the comment docs.

@HyukjinKwon HyukjinKwon merged commit c4749c5 into databricks:master Mar 13, 2020
@HyukjinKwon
Copy link
Member Author

Thanks @ueshin!

@HyukjinKwon HyukjinKwon deleted the index-iterable branch September 11, 2020 07:52
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.

Add complete .iloc support

3 participants