std())[-2]
if isnan(last):
anomaly = "outlier"
+ last = list(pd_data)[-1]
elif last < (trend - 3 * t_stdev):
anomaly = "regression"
elif last > (trend + 3 * t_stdev):
else:
anomaly = "normal"
- if not isnan(last) and not isnan(trend):
+ if not isnan(last) and not isnan(trend) and trend != 0:
# Change:
change = round(float(last - trend) / 1000000, 2)
# Relative change: