MCPcopy Index your code
hub / github.com/pydata/xarray / test_reduce_keepdims_bottleneck

Method test_reduce_keepdims_bottleneck

xarray/tests/test_dataarray.py:3152–3166  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3150
3151 @requires_bottleneck
3152 def test_reduce_keepdims_bottleneck(self) -> None:
3153 import bottleneck
3154
3155 coords = {
3156 "x": [-1, -2],
3157 "y": ["ab", "cd", "ef"],
3158 "lat": (["x", "y"], [[1, 2, 3], [-1, -2, -3]]),
3159 "c": -999,
3160 }
3161 orig = DataArray([[-1, 0, 1], [-3, 0, 3]], coords, dims=["x", "y"])
3162
3163 # Bottleneck does not have its own keepdims implementation
3164 actual = orig.reduce(bottleneck.nanmean, keepdims=True)
3165 expected = orig.mean(keepdims=True)
3166 assert_equal(actual, expected)
3167
3168 def test_reduce_dtype(self) -> None:
3169 coords = {

Callers

nothing calls this directly

Calls 4

reduceMethod · 0.95
DataArrayClass · 0.90
assert_equalFunction · 0.90
meanMethod · 0.45

Tested by

no test coverage detected