Skip to content

Commit 8405f65

Browse files
committed
handling dtype in test
1 parent 80e6225 commit 8405f65

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pandas/tests/groupby/test_grouping.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,10 +1187,11 @@ def test_groupby_any_with_timedelta():
11871187
df = DataFrame({"value": [pd.Timedelta(1), pd.NaT]})
11881188

11891189
# Perform groupby().any() operation
1190-
result = df.groupby([0, 1])["value"].any()
1190+
result = df.groupby(np.array([0, 1], dtype=np.int64))["value"].any()
11911191

11921192
# Expected result: group with NaT should return False
1193-
expected = Series({0: True, 1: False}, name="value")
1193+
expected = Series({0: True, 1: False}, name="value", dtype=bool)
1194+
expected.index = expected.index.astype(np.int64)
11941195

11951196
# Check if the result matches the expected output
11961197
tm.assert_series_equal(result, expected)

0 commit comments

Comments
 (0)