Skip to main content
Version: 8.1

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​

TypeParameterDescription
List[Float]valuesA 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.
FloatpercentileThe 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)

Keywords​

system math percentile, math.percentile