klyn.math.NDArray.mean
method
public mean(axes as IList<Long>, keepDims as Boolean = false, ignoreNaN as Boolean = false, where as Boolean[] = null, result as NDArray<Double> = null) as NDArray<Double>
Description

Arithmetic mean over several axes, with FP64 accumulation.

Parameters
ParameterDescription
axesDistinct axes; negative indices count from the end.
keepDimsKeep reduced dimensions with length one.
resultOptional non-aliased, shape-compatible destination reused without allocation.
ignoreNaNSkip NaNs; otherwise propagate them.
whereOptional flat Boolean mask, one entry per source element.
Returns

Reduced Double tensor; a scalar tensor has shape [1].

Throws
  • ValueException for invalid parameters or no selected observations.
  • IndexException for an axis outside the source rank.
Example

means = data.mean(axes=[0l, 2l], keepDims=true)