Function reference · Statistics
mean
Returns the arithmetic mean of a list or vector of values.
mean adds the supplied values and divides by their count. Pass individual expressions or a single vector; exact rational values are preserved when possible.
The same function is available to JavaScript and TypeScript callers from nerdamer/statistics.
Examples
These examples use Nerdamer Notation.
Compute a mean from separate arguments.
mean(2,4,6)
// → 4A single vector is unpacked.
mean([2,4,6])
// → 4Interfaces
The same operation is available through the interfaces below.
Nerdamer Notation
Use this form inside input passed to nerdamer(...).
mean(arg1, ...)
nerdamer.mean
Call the operation through the default nerdamer import.
nerdamer.mean(...args: StatisticsInput[]): Expression
Parameters
| Name | Type | Description |
|---|---|---|
args | StatisticsInput[] | — |
Returns
Direct JavaScript / TypeScript API
Import the operation directly from its package entry point.
import { mean } from 'nerdamer/statistics';
mean(...args: StatisticsInput[]): Expression
Parameters
| Name | Type | Description |
|---|---|---|
args | StatisticsInput[] | — |
