mirror of
https://github.com/anatolykopyl/DINS-test-assignment.git
synced 2026-03-26 12:55:05 +00:00
11 lines
267 B
Python
11 lines
267 B
Python
import numpy as np
|
|
|
|
|
|
def is_anomaly(result):
|
|
data = [item["value"] for name in result for item in result[name]]
|
|
|
|
x = np.array(data)
|
|
|
|
for name in result:
|
|
for item in result[name]:
|
|
item["anomaly"] = item["value"] > x.mean() + 3 * x.std() |