Skip to content

Commit ebde354

Browse files
authored
TST: Add test for large integer result in groupby.prod (#56384)
1 parent 04307e7 commit ebde354

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

pandas/tests/groupby/test_reductions.py

+24
Original file line numberDiff line numberDiff line change
@@ -1057,3 +1057,27 @@ def test_regression_allowlist_methods(op, axis, skipna, sort):
10571057
if sort:
10581058
expected = expected.sort_index(axis=axis)
10591059
tm.assert_frame_equal(result, expected)
1060+
1061+
1062+
def test_groupby_prod_with_int64_dtype():
1063+
# GH#46573
1064+
data = [
1065+
[1, 11],
1066+
[1, 41],
1067+
[1, 17],
1068+
[1, 37],
1069+
[1, 7],
1070+
[1, 29],
1071+
[1, 31],
1072+
[1, 2],
1073+
[1, 3],
1074+
[1, 43],
1075+
[1, 5],
1076+
[1, 47],
1077+
[1, 19],
1078+
[1, 88],
1079+
]
1080+
df = DataFrame(data, columns=["A", "B"], dtype="int64")
1081+
result = df.groupby(["A"]).prod().reset_index()
1082+
expected = DataFrame({"A": [1], "B": [180970905912331920]}, dtype="int64")
1083+
tm.assert_frame_equal(result, expected)

0 commit comments

Comments
 (0)