Private
Public Access
1
0

passing tests

This commit is contained in:
2024-04-18 19:44:33 +02:00
parent eb44623e24
commit a53d932c59
8 changed files with 59 additions and 47 deletions

View File

@@ -440,17 +440,19 @@ def wavg(group, avg_name, weight_name):
"""
try:
d = group[avg_name]
except KeyError:
except (KeyError, ColumnNotFoundError):
return 0
try:
w = group[weight_name]
except KeyError:
except (KeyError, ColumnNotFoundError):
return d.mean()
try:
return (d * w).sum() / w.sum()
except ZeroDivisionError: # pragma: no cover
return d.mean()
return 0
from string import Formatter
def totaltime_sec_to_string(totaltime, shorten=False):