MCPcopy Create free account
hub / github.com/dask/dask / test_average_weights

Function test_average_weights

dask/array/tests/test_routines.py:2785–2794  ·  view source on GitHub ↗
(keepdims)

Source from the content-addressed store, hash-verified

2783
2784@pytest.mark.parametrize("keepdims", [False, True])
2785def test_average_weights(keepdims):
2786 a = np.arange(6).reshape((3, 2))
2787 d_a = da.from_array(a, chunks=2)
2788
2789 weights = np.array([0.25, 0.75])
2790 d_weights = da.from_array(weights, chunks=2)
2791
2792 da_avg = da.average(d_a, weights=d_weights, axis=1, keepdims=keepdims)
2793
2794 assert_eq(da_avg, np.average(a, weights=weights, axis=1, keepdims=keepdims))
2795
2796
2797def test_average_raises():

Callers

nothing calls this directly

Calls 3

assert_eqFunction · 0.90
reshapeMethod · 0.80
arangeMethod · 0.45

Tested by

no test coverage detected