Skip to content

Commit 1e944f4

Browse files
author
Mateusz
committed
TST: Add test to check_below_min_count showing that it works fine for dfs with large row count
GH35385
1 parent fcab848 commit 1e944f4

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

pandas/tests/test_nanops.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,3 +1090,21 @@ def test_nanops_independent_of_mask_param(operation):
10901090
median_expected = operation(s)
10911091
median_result = operation(s, mask=mask)
10921092
assert median_expected == median_result
1093+
1094+
1095+
@pytest.mark.parametrize("min_count", [-1, 0])
1096+
def test_check_below_min_count__negative_or_zero_min_count(min_count):
1097+
result = nanops.check_below_min_count((21, 37), None, min_count)
1098+
expected_result = False
1099+
assert result == expected_result
1100+
1101+
1102+
@pytest.mark.parametrize(
1103+
"mask", [None, np.array([False, False, True]), np.array([True] + 2244366 * [False])]
1104+
)
1105+
@pytest.mark.parametrize("min_count, expected_result", [(1, False), (2812191852, True)])
1106+
def test_check_below_min_count__positive_min_count(mask, min_count, expected_result):
1107+
# shape taken to show that the issue with GH35227 is fixed
1108+
shape = (2244367, 1253)
1109+
result = nanops.check_below_min_count(shape, mask, min_count)
1110+
assert result == expected_result

0 commit comments

Comments
 (0)