Handbook
Glossary
shaped-mean ( array axes keepdims? -- result )
NumPy-style shaped-array operations
Prev:
shaped-sum ( array axes keepdims? -- result )
Next:
shaped-min ( array axes keepdims? -- result )
Vocabulary
arrays
.
shaped
Inputs
array
a
shaped-array
, a
sequence
, or a
number
axes
an
integer
, a
sequence
, or f
keepdims?
a boolean
Outputs
result
a
shaped-array
Word description
Computes the arithmetic mean using the axis and result-shape rules of shaped-sum, dividing by a floating-point element count. Empty means are NaN. Unlike NumPy, this word does not emit a runtime warning for empty means.
Definition
USING:
arrays.shaped.private
kernel
math
;
IN:
arrays.shaped
:
shaped-mean
( array axes keepdims? -- result )
0
[
+
]
reduce-shaped
dup
zero?
[
drop
[
drop
0/0.
]
shaped-map
]
[
>float
'[
_
/
]
shaped-map
]
if
;