Datasets:
Download source/tests/solvers/cmp_smooth.py from Syndicate604/skills-desk: direct link, hf CLI and curl.
- Browser
- Download file 421 Bytes
-
https://huggingface.co/datasets/Syndicate604/skills-desk/resolve/main/source/tests/solvers/cmp_smooth.py
- Command line
-
hf download hf://datasets/Syndicate604/skills-desk/source/tests/solvers/cmp_smooth.py
-
curl -L -o cmp_smooth.py https://huggingface.co/datasets/Syndicate604/skills-desk/resolve/main/source/tests/solvers/cmp_smooth.py
421 Bytes
| import csv, json, re | |
| limit = float(re.search(r"above (\d+)", open("METHOD.md").read()).group(1)) | |
| by = {} | |
| for r in csv.DictReader(open("samples.csv")): by.setdefault(r["sensor"], []).append((int(r["seq"]), float(r["temp_c"]))) | |
| out = {} | |
| for s, v in by.items(): | |
| v = [x for _, x in sorted(v)] | |
| out[s] = sum(sorted(v[i - 1:i + 2])[1] > limit for i in range(1, len(v) - 1)) | |
| json.dump(out, open("exceedances.json", "w")) | |