Skip to content
Snippets Groups Projects
Commit 2a5564be authored by Mgr. Aleš Křenek Ph.D.'s avatar Mgr. Aleš Křenek Ph.D.
Browse files

count non-zero CNAS -- useless for the discrete values, for refernce only

parent 02831a7f
Branches
No related tags found
No related merge requests found
#!/usr/bin/env python3
import json
import sys
with open(sys.argv[1]) as fin:
j = json.load(fin)
cnt = {}
for k in j:
id = k['pdxmodel_id']
# print(id)
for c in k['cnas']:
if c['value_of'] != 0.0:
if id in cnt:
cnt[id] += 1
else:
cnt[id] = 1
for k in sorted(cnt.keys(), key=lambda x: cnt[x]):
print(k, cnt[k])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment