Skip to content

Commit

Permalink
Ignore nulls when computing averages (?)
Browse files Browse the repository at this point in the history
Maybe if too many nulls are encountered, should invalidate the
whole result
  • Loading branch information
drmalex07 committed Dec 3, 2015
1 parent 07cea77 commit 8cb9896
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion alerts/lib/collected_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def avg(self, ds, start, resolution):
ds_values = []
for t, values in res:
v = values[ds]
if v == v:
if not (v is None) and (v == v):
ds_values.append(v)
if ds_values:
avg = math.fsum(ds_values)/len(ds_values)
Expand Down

0 comments on commit 8cb9896

Please sign in to comment.