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)
// → 4

A single vector is unpacked.

mean([2,4,6])
// → 4

Interfaces

The same operation is available through the interfaces below.

Nerdamer Notation · nerdamer API · Direct API

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

NameTypeDescription
argsStatisticsInput[]—

Returns

Expression

Browse the nerdamer API →

Direct JavaScript / TypeScript API

Import the operation directly from its package entry point.

import { mean } from 'nerdamer/statistics';
mean(...args: StatisticsInput[]): Expression

Parameters

NameTypeDescription
argsStatisticsInput[]—

Returns

Expression

Browse nerdamer/statistics →

← Back to Function reference