# series_stats()series_stats()

`series_stats()` 使用多个列返回数字序列的统计信息。`series_stats()` returns statistics for a numerical series using multiple columns.

`series_stats()` 函数将一个返回动态数值数组的表达式作为输入，并计算以下统计信息：The `series_stats()` function takes an expression returning a dynamical numerical array as input, and calculates the following statistics:

`min` 输入数组中的最小值。Minimum value in the input array.
`min_idx` 输入数组中最小值的第一个位置。The first position of the minimum value in the input array.
`max` 输入数组中的最大值。Maximum value in the input array.
`max_idx` 输入数组中最大值的第一个位置。First position of the maximum value in the input array.
`avg` 输入数组的平均值。Average value of the input array.
`variance` 输入数组的样本方差。Sample variance of input array.
`stdev` 输入数组的样本标准偏差。Sample standard deviation of the input array.

## 语法Syntax

`...` `|` `extend` `series_stats` `(` Expr [`,` IgnoreNonFinite] `)``...` `|` `extend` `series_stats` `(` Expr [`,` IgnoreNonFinite] `)`

`...` `|` `extend` `(` Name1 [`,` Name2...] `)` `=` `series_stats` `(` Expr [`,` IgnoreNonFinite] `)``...` `|` `extend` `(` Name1 [`,` Name2...] `)` `=` `series_stats` `(` Expr [`,` IgnoreNonFinite] `)`

## 参数Arguments

• Expr：一个返回 `dynamic` 类型值的表达式，该值包含一个数值数组。Expr: An expression that returns a value of type `dynamic`, holding an array of numeric values. 数值是为其定义了算术运算符的值。Numeric values are values for which arithmetic operators are defined.

• IgnoreNonFinite：一个布尔表达式，指定是否在计算统计信息时忽略 Expr 的非有限值（`null``NaN``inf` 等）。IgnoreNonFinite: A Boolean expression that specifies whether to calculate the statistics while ignoring non-finite values of Expr (`null`, `NaN`, `inf`, and so on). 如果为 `false`，则 Expr 中具有此值的单个项会为所有统计值生成一个值，即 `null`If `false`, a single item in Expr with this value will result in a value of `null` generated for all statistics values. 默认值为 `false`The default value is `false`.

## 返回Returns

### 语法 1Syntax 1

`...` `|` `extend` `series_stats` `(` Expr [`,` IgnoreNonFinite] `)``...` `|` `extend` `series_stats` `(` Expr [`,` IgnoreNonFinite] `)`

### 语法 2Syntax 2

`...` `|` `extend` `(` Name1 [`,` Name2...] `)` `=` `series_stats` `(` Expr [`,` IgnoreNonFinite] `)``...` `|` `extend` `(` Name1 [`,` Name2...] `)` `=` `series_stats` `(` Expr [`,` IgnoreNonFinite] `)`

## 示例Example

``````print x=dynamic([23,46,23,87,4,8,3,75,2,56,13,75,32,16,29])
| project series_stats(x)

``````
series_stats_x_minseries_stats_x_min series_stats_x_min_idxseries_stats_x_min_idx series_stats_x_maxseries_stats_x_max series_stats_x_max_idxseries_stats_x_max_idx series_stats_x_avgseries_stats_x_avg series_stats_x_stdevseries_stats_x_stdev series_stats_x_varianceseries_stats_x_variance
22 88 8787 33 32.832.8 28.503633853548328.5036338535483 812.457142857143812.457142857143