klyn.math.NDArray.histogram
method
public histogram(notnull edges as NDArray<Double>, density as Boolean = false, weights as NDArray<Double> = null, ignoreNaN as Boolean = false) as Tuple<NDArray<Double>, NDArray<Double>>
Description

Histogram with explicitly supplied finite ascending boundaries; source unchanged.

Parameters
ParameterDescription
edgesAt least two strictly increasing 1D boundaries.
densityNormalize by included weight and bin width.
weightsOptional finite Double weights, same shape as source.
ignoreNaNSkip NaN observations/weights; otherwise raise.
Returns

Double counts/densities and an independent edge copy.

Throws
  • ValueException for invalid edges/weights or zero density mass.
  • NullException if edges is null at runtime; statically null arguments are rejected with TypeError.
Example

counts, edges = data.histogram(NDArray<Double>([0.0, 1.0, 4.0]))