mean
Averages a matrix, optionally grouped by rows or cols, dividing only by the
count of valid values.
API Reference
Signature
Parameters
Returns
Same shape as sum: a value, a matrix of length-1 rows, or an array,
depending on by. Empty buckets are "-".
Throws
MATRIX_INVALID_AGGREGATE_OPTIONS— invalidbyor non-functionusing.
Agent Contract
Agent Notes
- The denominator is the count of valid values only;
"-"andundefinedare excluded, not treated as zero. - Unlike sum, a
usingoverride is not expected to preserve averaging semantics — it can compute anything from the valid values.