-
Notifications
You must be signed in to change notification settings - Fork 48
feat: Add pivot_table for DataFrame. #473
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
bigframes/dataframe.py
Outdated
if isinstance(index, blocks.Label): | ||
index = [index] | ||
else: | ||
index = list(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.
Does this have the correct behavior for tuples? Tuples are tricky because they can be interpreted as individual labels or list of labels.
... columns='Region' | ||
... ) | ||
>>> pivot_table | ||
Rating Sales |
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] is the indentation alright here, also below?
|
||
columns (str or object or a list of str): | ||
Column to use to make new frame's columns. | ||
aggfunc (str, default "mean"): |
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] no newline like after other params
@@ -2554,6 +2554,34 @@ def test_df_pivot_hockey(hockey_df, hockey_pandas_df, values, index, columns): | |||
pd.testing.assert_frame_equal(bf_result, pd_result, check_dtype=False) | |||
|
|||
|
|||
@pytest.mark.parametrize( | |||
("values", "index", "columns", "aggfunc"), |
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.
can we also test for the default values of these params?
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
e264a0a
to
a605890
Compare
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:
Docs screenshot:
https://screenshot.googleplex.com/3FC5wP45SBFnPXi
https://screenshot.googleplex.com/BPfCJ6a5caWdvbi
https://screenshot.googleplex.com/Bd9XqEFv8X2d4sw
Fixes #<issue_number_goes_here> 🦕