Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Daniel Boeckenhoff
tfields
Commits
bfcced83
Commit
bfcced83
authored
Nov 27, 2018
by
Daniel Boeckenhoff
Browse files
test moment(0)
parent
d9ad4682
Changes
1
Hide whitespace changes
Inline
Side-by-side
tfields/core.py
View file @
bfcced83
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment