klyn.math.NDArray.percentile
method
public percentile(q as Double, method as QuantileMethod = QuantileMethod.Linear, ignoreNaN as Boolean = false, where as Boolean[] = null) as Double
Description

Exact sample percentile with q in [0,100]. Source data is never sorted or changed. Expected O(N) selection, O(N log N) worst case; O(N) scratch.

Parameters
ParameterDescription
qRequested percentile; finite and within its documented range.
methodRank interpolation; default Linear, nearest ties to even.
ignoreNaNSkip NaNs; otherwise propagate them.
whereOptional flat Boolean mask, one entry per source element.
Returns

Scalar Double.

Throws
  • ValueException for invalid parameters or no selected observations.
Example

middle = data.percentile(0.5)