Skip to content

Conversation

@itholic
Copy link
Contributor

@itholic itholic commented Mar 19, 2020

This PR proposes Series.take(), Index.take(), MultiIndex.take().

  • Series
>>> kser = ks.Series([100, 200, 300, 400, 500])
>>> kser
0    100
1    200
2    300
3    400
4    500
Name: 0, dtype: int64

>>> kser.take([0, 2, 4]).sort_index()
0    100
2    300
4    500
Name: 0, dtype: int64
  • Index
>>> kidx = ks.Index([100, 200, 300, 400, 500])
>>> kidx
Int64Index([100, 200, 300, 400, 500], dtype='int64')

>>> kidx.take([0, 2, 4]).sort_values()
Int64Index([100, 300, 500], dtype='int64')
  • MultiIndex
>>> kmidx = ks.MultiIndex.from_tuples([("x", "a"), ("x", "b"), ("x", "c")])
>>> kmidx
MultiIndex([('x', 'a'),
            ('x', 'b'),
            ('x', 'c')],
           )

>>> kmidx.take([0, 2])
MultiIndex([('x', 'a'),
            ('x', 'c')],
           )

@codecov-io
Copy link

codecov-io commented Mar 19, 2020

Codecov Report

Merging #1357 into master will decrease coverage by 2.20%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1357      +/-   ##
==========================================
- Coverage   95.25%   93.05%   -2.21%     
==========================================
  Files          34       34              
  Lines        7610     7613       +3     
==========================================
- Hits         7249     7084     -165     
- Misses        361      529     +168     
Impacted Files Coverage Δ
databricks/koalas/missing/indexes.py 100.00% <ø> (ø)
databricks/koalas/missing/series.py 100.00% <ø> (ø)
databricks/koalas/base.py 97.37% <100.00%> (+0.07%) ⬆️
databricks/koalas/usage_logging/__init__.py 24.32% <0.00%> (-71.18%) ⬇️
databricks/koalas/usage_logging/usage_logger.py 50.00% <0.00%> (-50.00%) ⬇️
databricks/koalas/__init__.py 78.72% <0.00%> (-14.90%) ⬇️
databricks/conftest.py 88.67% <0.00%> (-7.55%) ⬇️
databricks/koalas/frame.py 93.70% <0.00%> (-3.02%) ⬇️
databricks/koalas/namespace.py 86.26% <0.00%> (-1.50%) ⬇️
databricks/koalas/plot.py 93.33% <0.00%> (-0.96%) ⬇️

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 283ee1d...9e3ec73. Read the comment docs.

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.

Otherwise, LGTM.

@ueshin
Copy link
Collaborator

ueshin commented Mar 20, 2020

Thanks! merging.

@ueshin ueshin merged commit 25458a6 into databricks:master Mar 20, 2020
@itholic itholic deleted the base_take branch March 20, 2020 00:26
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.

3 participants