-
Notifications
You must be signed in to change notification settings - Fork 48
feat: add df.unstack #63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -729,6 +729,26 @@ def test_column_multi_index_stack(scalars_df_index, scalars_pandas_df_index): | |||
) | |||
|
|||
|
|||
def test_column_multi_index_unstack(scalars_df_index, scalars_pandas_df_index): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit] would test_multi_column_unstack
better represent this test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My naming convention is based on the initial dataframe object, column_multi_index indicating that the initial column axis is a multi-index. Open to changing this convention, but it is inline with how I've named the tests so far.
) | ||
pd_result = hockey_pandas_df.set_index( | ||
["team_name", "season", "position"] | ||
).unstack() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be worth testing for all levels: {-3, -2, -1, 0, 1, 2}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't support levels param yet. Will add levels support to stack() and unstack() in a later pr.
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #<issue_number_goes_here> 🦕