Skip to content

Conversation

@itholic
Copy link
Contributor

@itholic itholic commented Jul 5, 2020

This should close #1615

>>> kser = ks.Series(
...     [1, 2, 3],
...     index=pd.MultiIndex.from_tuples(
...         [("x", "a"), ("x", "b"), ("y", "c")], names=["level_1", "level_2"]
...     ),
... )
>>> kser
level_1  level_2
x        a          1
         b          2
y        c          3
Name: 0, dtype: int64

Removing specific index level by level

>>> kser.droplevel(0)
level_2
a    1
b    2
c    3
Name: 0, dtype: int64

Removing specific index level by name

>>> kser.droplevel("level_2")
level_1
x    1
x    2
y    3
Name: 0, dtype: int64

@HyukjinKwon
Copy link
Member

Let's combine and address the leftover issues here @itholic

@itholic
Copy link
Contributor Author

itholic commented Jul 10, 2020

@HyukjinKwon I got it! Thanks for the notice

@itholic itholic changed the title Implementing Series.droplevel [WIP] Implementing Series.droplevel Jul 13, 2020
@itholic itholic changed the title [WIP] Implementing Series.droplevel Implementing Series.droplevel Jul 13, 2020
@itholic
Copy link
Contributor Author

itholic commented Jul 14, 2020

I think this PR ready to get review.

@itholic
Copy link
Contributor Author

itholic commented Jul 15, 2020

Thanks, @ueshin. I'll manage things that you pointed out.

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.

@ueshin
Copy link
Collaborator

ueshin commented Jul 15, 2020

Thanks! merging.

@ueshin ueshin merged commit ae30c38 into databricks:master Jul 15, 2020
@itholic itholic deleted the s_droplevel branch July 25, 2020 04:08
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.

Series.droplevel

3 participants