Skip to content

← statistics package

Percentiles

Calculate percentiles of an array along some axis.

The node can also be configured to calculate quantiles instead of percentiles. The specified axis will be replaced by a new axis whose length matches the number of given percentiles, and which appears in the same position as the old axis. The type of the axis can be selected via the new axis property. More Info... Version 0.8.0

Ports/Properties

data

Data to process.

verbose name
Data
default value
None
port type
DataPort
value type
AnyNumeric (can be None)
data direction
INOUT

axis

Axis along which to calculate percentiles. You can also enter the axis label here as in feature.mylabel.

verbose name
Axis
default value
axis
port type
ComboPort
value type
str (can be None)

percentiles

List of percentiles to calculate. Percentiles are numbers between 0 and 100, inclusive, where 0 is the minimum, 100 is the maximum, and 50 is the median. If you want

verbose name
Percentiles
default value
[50]
port type
Port
value type
object (can be None)

unit

Optionally the unit in which the percentiles are given. If set to 'percentile', the percentiles are given as percentages, i.e., 0 to 100. If set to 'quantile', the percentiles are given as fractions, i.e., 0 to 1.

verbose name
Unit
default value
percentile
port type
EnumPort
value type
str (can be None)

ignore_nans

If set, NaN values will be ignored in the calculation. As a result, the percentiles pertain to remaining elements that are not NaN. Otherwise NaNs will propagate into the respective outputs.

verbose name
Ignore Nan Values
default value
False
port type
BoolPort
value type
bool (can be None)

stream

Name of stream to process. Wildcards are supported, so mystream* will process all streams whose name starts with mystream.

verbose name
Stream
default value
None
port type
StringPort
value type
str (can be None)

new_axis

Type of the new axis to create. If set to 'feature', a new feature axis will be created with the percentiles as string labels. If set to 'statistic', a new statistic axis will be created that has the correct percentiles set; however, note that this requires that your percentiles to correspond to the predefined percentiles on the axis. You can also specify a desired new label for the axis in here by writing space.mylabel.

verbose name
New Axis
default value
feature
port type
ComboPort
value type
str (can be None)

method

Method to use when quantiles fall in between two data points. The first 9 methods correspond to methods 1-9 in "Sample quantiles in statistical packages" by Hyndman and Fan (1996). See also the URL that is part of the Node documentation for more details. However, as of NeuroPype 2023, these are only available when the node uses the default CPU (numpy) backend. To use this node in compiled or GPU portions of your graph (e.g., with DeepModel), you can only use the methods 'lower', 'higher', 'nearest', 'midpoint', and 'linear'. Of these, 'lower' returns the smaller value when the desired percentile is between two data points. 'higher' returns the larger value. 'nearest' rounds to the nearest value. 'midpoint' returns the average of the two nearest values. 'linear' interpolates linearly between the two. The 'hazen' method is the default of the MATLAB(tm) prctile function.

verbose name
Method
default value
linear
port type
EnumPort
value type
str (can be None)

set_breakpoint

Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.

verbose name
Set Breakpoint (Debug Only)
default value
False
port type
BoolPort
value type
bool (can be None)

metadata

User-definable meta-data associated with the node. Usually reserved for technical purposes.

verbose name
Metadata
default value
{}
port type
DictPort
value type
dict (can be None)