MCPcopy
hub / github.com/pydata/xarray / test_groupby_count

Method test_groupby_count

xarray/tests/test_groupby.py:1462–1470  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1460 assert_allclose(expected, actual)
1461
1462 def test_groupby_count(self) -> None:
1463 array = DataArray(
1464 [0, 0, np.nan, np.nan, 0, 0],
1465 coords={"cat": ("x", ["a", "b", "b", "c", "c", "c"])},
1466 dims="x",
1467 )
1468 actual = array.groupby("cat").count()
1469 expected = DataArray([1, 1, 2], coords=[("cat", ["a", "b", "c"])])
1470 assert_identical(actual, expected)
1471
1472 @pytest.mark.parametrize("shortcut", [True, False])
1473 @pytest.mark.parametrize("keep_attrs", [None, True, False])

Callers

nothing calls this directly

Calls 4

groupbyMethod · 0.95
DataArrayClass · 0.90
assert_identicalFunction · 0.90
countMethod · 0.45

Tested by

no test coverage detected