Skip to content

Instantly share code, notes, and snippets.

@orimanabu
Created September 13, 2019 14:59
Show Gist options
  • Save orimanabu/3d730b0e554abba1f91f984f15d361fe to your computer and use it in GitHub Desktop.
Save orimanabu/3d730b0e554abba1f91f984f15d361fe to your computer and use it in GitHub Desktop.
xxx
#!/usr/bin/python
import json
import sys
input_path = sys.argv[1]
print("* " + input_path)
f = open(input_path, 'r')
data = json.load(f)
metrics = data['MetricDataResults']
for m in metrics:
_id = m['Id']
label = m['Label']
timestamps = m['Timestamps']
values = m['Values']
for ts, val in zip(timestamps, values):
print(_id.encode() + ", " + label.encode() + ", " + ts.encode() + ", " + str(val))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment