Created
July 27, 2022 14:58
-
-
Save fukubaya/89d349678ebf435724256f78e4e167f6 to your computer and use it in GitHub Desktop.
COCOA exposure_data.json の集計
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import datetime | |
with open("exposure_data.json") as f: | |
exposure = json.load(f) | |
result = {} | |
for x in exposure["exposure_windows"]: | |
t = int(x['DateMillisSinceEpoch']) / 1000 | |
if t not in result: | |
result[t] = 0 | |
# COCOAログチェッカーは ScanInstances の数は見てなさそう | |
# result[t] += 1 | |
result[t] += len(x["ScanInstances"]) | |
for t in sorted(result.keys()): | |
dt = datetime.datetime.fromtimestamp(t) | |
print(f"{dt},{result[t]}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment