system.math.percentile
This function is used in Python Scripting.
Descriptionβ
Given a sequence of numerical values, estimates the percentile of input.
The percentile is a value on a scale that represents a percentage position in a list of data that can be equal to or below that value: i.e., the 25th percentile is a value below which 25% of observable data points may be found.
Client Permission Restrictionsβ
This scripting function has no Client Permission restrictions.
Syntaxβ
system.math.percentile(values, percentile)
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. |
| Float | percentile | The percentile to compute. A float greater than 0 and less than or equal to 100. Will throw an exception if the percentile is out of bounds. |
Returnsβ
Float - A value from the given list using the requested percentile of the input, 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.4, 3.8]
# Print the 75th percentile.
print system.math.percentile(values, 75)