Commit bfcced83 authored by Daniel Boeckenhoff's avatar Daniel Boeckenhoff
Browse files

test moment(0)

parent d9ad4682
......@@ -990,9 +990,6 @@ class Tensors(AbstractNdarray):
"""
Returns:
Moments of the distribution.
Note:
The first moment is given as the mean,
second as variance etc. Not 0 as it is mathematicaly correct.
Args:
moment (int): n-th moment
Examples:
......@@ -1001,7 +998,7 @@ class Tensors(AbstractNdarray):
Skalars
>>> t = tfields.Tensors(range(1, 6))
>>> t.moment(1)
>>> assert t.moment(1) == 0
>>> assert t.moment(1, weights=[-2, -1, 20, 1, 2]) == 0.5
>>> assert t.moment(2, weights=[0.25, 1, 17.5, 1, 0.25]) == 0.2
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment