docs-v2/content/flux/v0.x/stdlib/experimental/stddev.md

61 lines
1.6 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

---
title: experimental.stddev() function
description: >
The `experimental.stddev()` function computes the standard deviation of non-null
values in the `_value` column for each input table.
menu:
flux_0_x_ref:
name: experimental.stddev
parent: experimental
weight: 302
aliases:
- /influxdb/v2.0/reference/flux/stdlib/experimental/stddev/
- /influxdb/cloud/reference/flux/stdlib/experimental/stddev/
related:
- /flux/v0.x/stdlib/universe/stddev/
- /{{< latest "influxdb" "v1" >}}/query_language/functions/#stddev, InfluxQL STDDEV()
flux/v0.x/tags: [transformations, aggregates]
introduced: 0.107.0
---
The `experimental.stddev()` function computes the standard deviation of non-null
values in the `_value` column for each input table.
_`experimental.stddev()` is an [aggregate function](/flux/v0.x/function-types/#aggregates)._
```js
import "experimental"
experimental.stddev(mode: "sample")
```
## Parameters
### mode {data-type="string"}
The standard deviation mode or type of standard deviation to calculate.
Defaults to `"sample"`.
**Available options:**
- [sample](#sample)
- [population](#population)
##### sample
Calculate the sample standard deviation where the data is considered to be part of a larger population.
##### population
Calculate the population standard deviation where the data is considered a population of its own.
### tables {data-type="stream of tables"}
Input data.
Default is piped-forward data (`<-`).
## Examples
```js
import "experimental"
from(bucket: "example-bucket")
|> range(start: -5m)
|> filter(fn: (r) => r._measurement == "cpu" and r._field == "usage_system")
|> experimental.stddev()
```