Navigation :
Envision Tutorials
Envision Explanation
Envision How-To Guides
Lokad Platform
Envision Reference
- Glossary
- Platform overview
- List of icons
-
_
-
A-B-C
-- abs
-- actionrwd.dampen
-- actionrwd.demand
-- actionrwd.reward
-- actionrwd.segment
-- aggregators
-- all
-- and
-- any
-- areSame
-- argfirst
-- arglast
-- argmax
-- argmin
-- arground
-- argwhichever
-- as
-- assert
-- assertfail
-- assoc.quantity
-- at
-- auto
-- autodiff
-- avg
-- barchart
-- boolean
-- Built-in Tables
-- by
-- canonical
-- cdf
-- ceiling
-- changed
-- chart
-- comments
-- commonPrefix
-- complement
-- concat
-- connected
-- const
-- constant
-- consume
--
contains
-- containsAny
-- containsCount
-- cos
-- count
-- cross
-- crps
-- cuminv
-- cumsub
-- cumsum
-- currentDashUrl
-
D-E-F
-
G-H-I
-
J-K-L
-
M-N-O
-
P-Q-R
-
S-T-U
-
V-W-X
-
Y-Z
Envision Gallery
Envision Specifications
Envision Language
Legacy
avg
avg, function
def autodiff process avg(a: number): number
Returns the numerical average of the grouped numbers in a. For empty groups, it returns 0.
a: the numbers to average.
Examples
table T = with
[| as A, as B |]
[| 0, "a" |]
[| 0, "a" |]
[| 0, "b" |]
[| 1, "b" |]
[| 1, "c" |]
table G[gdim] = by T.B
show table "Average by group" with
gdim
avg(T.A)
group by gdim
Output:
gdim
avg(T.A)
a
0
b
0.5
c
1
This function is usable in autodiff contexts.
See also