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

Function _sum_of_squares

dask/array/stats.py:477–496  ·  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

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

Callers 1

f_onewayFunction · 0.85

Calls 1

sumMethod · 0.45

Tested by

no test coverage detected