@@ -1090,3 +1090,32 @@ def test_nanops_independent_of_mask_param(operation):
1090
1090
median_expected = operation (s )
1091
1091
median_result = operation (s , mask = mask )
1092
1092
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
+ # GH35227
1098
+ result = nanops .check_below_min_count ((21 , 37 ), None , min_count )
1099
+ expected_result = False
1100
+ assert result == expected_result
1101
+
1102
+
1103
+ @pytest .mark .parametrize (
1104
+ "mask" , [None , np .array ([False , False , True ]), np .array ([True ] + 9 * [False ])]
1105
+ )
1106
+ @pytest .mark .parametrize ("min_count, expected_result" , [(1 , False ), (101 , True )])
1107
+ def test_check_below_min_count__positive_min_count (mask , min_count , expected_result ):
1108
+ # GH35227
1109
+ shape = (10 , 10 )
1110
+ result = nanops .check_below_min_count (shape , mask , min_count )
1111
+ assert result == expected_result
1112
+
1113
+
1114
+ @td .skip_if_windows
1115
+ @td .skip_if_32bit
1116
+ @pytest .mark .parametrize ("min_count, expected_result" , [(1 , False ), (2812191852 , True )])
1117
+ def test_check_below_min_count__large_shape (min_count , expected_result ):
1118
+ # GH35227 large shape used to show that the issue is fixed
1119
+ shape = (2244367 , 1253 )
1120
+ result = nanops .check_below_min_count (shape , mask = None , min_count = min_count )
1121
+ assert result == expected_result
0 commit comments