system.math.sumSquares
This function is used in Python Scripting.
Descriptionβ
Given a sequence of values, calculates the sum of the squares of all values. Sum squares measures how far individual values are from the mean by calculating how much variation there is in a set of values.
Returns NaN (Not a Number) if passed an empty sequence.
Client Permission Restrictionsβ
This scripting function has no Client Permission restrictions.
Syntaxβ
system.math.sumSquares(values)
Parametersβ
| Type | Parameter | Description |
|---|---|---|
| List[Float] | values | A sequence of numerical values. Accepts both integers and floats. The sequence may not contain None type values. However, passing a None type object instead of a sequence of numerical values will return NaN. |
Returnsβ
Float - The sum of all squares of the 'values' parameter, or NaN if the input was empty or null.
Scopeβ
Gateway, Vision Client, Perspective Session
Code Examplesβ
Example #1
# Create a list of values.
values = [3.5, 5.6, 7.8, 7.4, 3.8]
# Print the resulting value.
print system.math.sumSquares(values)