Skip to content

Instantly share code, notes, and snippets.

@garanews
Last active March 4, 2019 07:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garanews/02e051a555bbf83cde527b9f086b1b26 to your computer and use it in GitHub Desktop.
Save garanews/02e051a555bbf83cde527b9f086b1b26 to your computer and use it in GitHub Desktop.
Generate table with matrix of all features of all cortex analyzers
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