MCPcopy
hub / github.com/pandas-dev/pandas / test_reduce_empty

Function test_reduce_empty

pandas/tests/arrays/string_/test_string.py:280–294  ·  view source on GitHub ↗
(skipna, dtype, min_count)

Source from the content-addressed store, hash-verified

278
279@pytest.mark.parametrize("min_count", [0, 1])
280def test_reduce_empty(skipna, dtype, min_count):
281 arr = pd.Series([], dtype=dtype)
282 result = arr.sum(skipna=skipna, min_count=min_count)
283 if min_count == 0:
284 assert result == ""
285 else:
286 assert pd.isna(result)
287
288 # all-missing
289 arr = pd.Series([None, None], dtype=dtype)
290 result = arr.sum(skipna=skipna, min_count=min_count)
291 if skipna and min_count == 0:
292 assert result == ""
293 else:
294 assert pd.isna(result)
295
296
297@pytest.mark.parametrize("method", ["min", "max"])

Callers

nothing calls this directly

Calls 2

sumMethod · 0.95
isnaMethod · 0.45

Tested by

no test coverage detected