Last active
March 4, 2019 07:55
-
-
Save garanews/02e051a555bbf83cde527b9f086b1b26 to your computer and use it in GitHub Desktop.
Generate table with matrix of all features of all cortex analyzers
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 | |
from glob import glob | |
import pandas as pd | |
list_json = glob('**/*.json') | |
all = [] | |
for jj in list_json: | |
command = jj.split("/")[-2] | |
dict_json = json.loads("".join(open(jj, 'r').readlines())) | |
for x in dict_json['dataTypeList']: | |
if (command, x, 1) not in all: | |
all.append((command, x, 1)) | |
df = pd.DataFrame(all, columns=['analyzer', 'type', 'ok']) | |
pd.pivot_table(df, values='ok', index='analyzer', columns=['type']).replace(1.0, 'X').to_csv('/tmp/features.csv') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment