system.math.normalize
This function is used in Python Scripting.
Descriptionβ
Given a sequence of values, normalizes the values. Normalizing data refers to adjusting values measured on different scales and brings them into alignment to allow the comparison of corresponding normalized values. This creates uniformity of values by eliminating the different units of measurement, and to more easily compare data from different places.
Returns an empty list if the sequence was empty or None.
Client Permission Restrictionsβ
This scripting function has no Client Permission restrictions.
Syntaxβ
system.math.normalize(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. |
Returnsβ
List[Float] - A Java array (functionally similar to a Python list) of floats representing normalized input, with a mean of 0 and a standard deviation of 1. Returns an empty array if the input was empty or None. If the standard deviation is 0, will return an array of float NaN (Not a Number).
Scopeβ
Gateway, Vision Client, Perspective Session
Code Examplesβ
# Create a list of values.
values = [3.5, 5.6, 7.8, 7.4, 7.8]
# Return the most common values.
normalized = system.math.normalize(values)
# Print the first item in the result.
print normalized[0]
# Iterate over the results.
for number in normalized:
print number