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

Function w_sum

dask/array/tests/test_reductions.py:955–961  ·  view source on GitHub ↗

`chunk` callable for (weighted) sum

(x, weights=None, dtype=None, computing_meta=False, **kwargs)

Source from the content-addressed store, hash-verified

953def test_weighted_reduction():
954 # Weighted reduction
955 def w_sum(x, weights=None, dtype=None, computing_meta=False, **kwargs):
956 """`chunk` callable for (weighted) sum"""
957 if computing_meta:
958 return x
959 if weights is not None:
960 x = x * weights
961 return np.sum(x, dtype=dtype, **kwargs)
962
963 # Arrays
964 a = 1 + np.ma.arange(60).reshape(6, 10)

Callers

nothing calls this directly

Calls 1

sumMethod · 0.45

Tested by

no test coverage detected