Documentation

mean() function

mean() is experimental and subject to change at any time. By using this function, you accept the risks of experimental functions.

mean() returns the average of non-null values in a specified column from each input table.

Note: universe.mean() is an experimental function with a more precise type signature.

Function type signature
(<-tables: stream[{B with A: C}], ?column: A = "_value") => stream[{A: C}] where A: Label, B: Record, C: Numeric
For more information, see Function type signatures.

Parameters

column

Column to use to compute means. Default is _value.

tables

Input data. Default is piped-forward data (<-).

Examples

Return the average of values in each input table

import "experimental/universe"
import "sampledata"

sampledata.int()
    |> universe.mean()

View example input and ouput


Was this page helpful?

Thank you for your feedback!


Upgrade to InfluxDB Cloud or InfluxDB 2.0!

InfluxDB Cloud and InfluxDB OSS 2.0 ready for production.