avg

Contents

avg#

avg(input)[source]#

Calculates the average (mean) of non-null elements in the input expression.

See also

This SQL Function has aliases.

Example:

SQL#
SELECT avg(x) FROM tbl
Input#
╭───────╮
│ x     │
│ ---   │
│ Int64 │
╞═══════╡
│ 100   │
├╌╌╌╌╌╌╌┤
│ 200   │
├╌╌╌╌╌╌╌┤
│ null  │
╰───────╯
(Showing first 3 of 3 rows)
Output#
╭───────────╮
│ x         │
│ ---       │
│ Float64   │
╞═══════════╡
│ 150.0     │
╰───────────╯
(Showing first 1 of 1 rows)