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

Function _square_of_sums

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

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

Callers 1

f_onewayFunction · 0.85

Calls 1

sumMethod · 0.45

Tested by

no test coverage detected