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

Function _sum_of_squares

dask/array/stats.py:476–495  ·  view source on GitHub ↗

Squares each element of the input array, and returns the sum(s) of that. Parameters ---------- a : array_like Input array. axis : int or None, optional Axis along which to calculate. Default is 0. If None, compute over the whole array `a`. Returns

(a, axis=0)

Source from the content-addressed store, hash-verified

474
475
476def _sum_of_squares(a, axis=0):
477 """
478 Squares each element of the input array, and returns the sum(s) of that.
479 Parameters
480 ----------
481 a : array_like
482 Input array.
483 axis : int or None, optional
484 Axis along which to calculate. Default is 0. If None, compute over
485 the whole array `a`.
486 Returns
487 -------
488 sum_of_squares : ndarray
489 The sum along the given axis for (a**2).
490 See also
491 --------
492 _square_of_sums : The square(s) of the sum(s) (the opposite of
493 `_sum_of_squares`).
494 """
495 return da.sum(a * a, axis)
496
497
498def _square_of_sums(a, axis=0):

Callers 1

f_onewayFunction · 0.85

Calls 1

sumMethod · 0.45

Tested by

no test coverage detected