-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
TST: Added a test for groupby.prod #56384
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
Changes from 5 commits
899110f
93059c5
c2455bf
6baa460
2dbae66
30e2701
66e50f6
96bf104
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1057,3 +1057,27 @@ def test_regression_allowlist_methods(op, axis, skipna, sort): | |
if sort: | ||
expected = expected.sort_index(axis=axis) | ||
tm.assert_frame_equal(result, expected) | ||
|
||
|
||
@pytest.mark.parametrize("multiplier", range(90)) | ||
def test_prod_groupby_consistency_values(multiplier): | ||
data = [ | ||
ccccjone marked this conversation as resolved.
Show resolved
Hide resolved
|
||
[1, 10], | ||
[1, 21], | ||
[1, 32], | ||
[1, 43], | ||
[1, 54], | ||
[1, 67], | ||
[1, 78], | ||
[1, 89], | ||
[1, 5], | ||
[1, 17], | ||
[1, 37], | ||
[1, 47], | ||
[1, 99], | ||
[1, multiplier], | ||
] | ||
df = DataFrame(data, columns=["A", "B"]) | ||
df_prod = DataFrame([df.prod()], columns=df.columns) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you hardcode this instead (assuming the parametrization will be removed) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. By "hardcode", I mean something like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @rhshadrach Sorry for the misunderstanding. I have now updated the code based on your explanation. Could you please take a look and let me know if this is now correct, or if there are any further modifications needed? Thanks for your kind assistance. |
||
df_groupby_prod = df.groupby(["A"]).prod().reset_index() | ||
tm.assert_frame_equal(df_prod, df_groupby_prod) | ||
ccccjone marked this conversation as resolved.
Show resolved
Hide resolved
|
Uh oh!
There was an error while loading. Please reload this page.