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

Function _square_of_sums

dask/array/stats.py:498–517  ·  view source on GitHub ↗

Sums elements of the input array, and returns the square(s) of that sum. 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

496
497
498def _square_of_sums(a, axis=0):
499 """
500 Sums elements of the input array, and returns the square(s) of that sum.
501 Parameters
502 ----------
503 a : array_like
504 Input array.
505 axis : int or None, optional
506 Axis along which to calculate. Default is 0. If None, compute over
507 the whole array `a`.
508 Returns
509 -------
510 square_of_sums : float or ndarray
511 The square of the sum over `axis`.
512 See also
513 --------
514 _sum_of_squares : The sum of squares (the opposite of `square_of_sums`).
515 """
516 s = da.sum(a, axis)
517 return s * s

Callers 1

f_onewayFunction · 0.85

Calls 1

sumMethod · 0.45

Tested by

no test coverage detected