docs-v2/content/flux/v0.x/stdlib/universe/mean.md

1.7 KiB
Raw Permalink Blame History

title description aliases menu weight flux/v0.x/tags related introduced
mean() function The `mean()` function computes the mean or average of non-null records in the input table.
/influxdb/v2.0/reference/flux/functions/transformations/aggregates/mean
/influxdb/v2.0/reference/flux/functions/built-in/transformations/aggregates/mean/
/influxdb/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/mean/
/influxdb/cloud/reference/flux/stdlib/built-in/transformations/aggregates/mean/
flux_0_x_ref
name parent
mean universe
102
aggregates
transformations
/{{< latest "influxdb" "v1" >}}/query_language/functions/#mean, InfluxQL MEAN()
/flux/v0.x/stdlib/experimental/mean/
0.7.0

The mean() function computes the mean or average of non-null records in the input table. mean() is an aggregate function.

Output data type: Float

mean(column: "_value")

Parameters

column

Column to use to compute the mean. Default is "_value".

tables

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

Examples

{{% flux/sample-example-intro %}}

import "sampledata"

sampledata.int()
    |> mean()

{{% expand "View input and output" %}} {{< flex >}} {{% flex-content %}}

Input data

{{% flux/sample "int" %}}

{{% /flex-content %}} {{% flex-content %}}

Output data
tag _value
t1 8.5
tag _value
t2 8.833333333333334

{{% /flex-content %}} {{< /flex >}} {{% /expand %}}