mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
Fix mean calculation
This commit is contained in:
parent
1f2ff22a98
commit
6b12c90e88
1 changed files with 6 additions and 2 deletions
|
@ -563,7 +563,11 @@ def _calculate_stats_mean(stats):
|
|||
if isinstance(v, dict):
|
||||
s[k] = _mean(v, t, ts)
|
||||
elif isinstance(v, list):
|
||||
try:
|
||||
nums = [ float(x * t[i]) for i, x in enumerate(v) ]
|
||||
except:
|
||||
pass
|
||||
else:
|
||||
s[k] = sum(nums) / float(ts)
|
||||
return s
|
||||
|
||||
|
|
Loading…
Reference in a new issue