from json import dump from src.data_interface import trd, L from src.utils import get_path sess_root = get_path(__file__) + '/../scr' summary_statistics = ['min', 'max', 'mean', 'std'] features_to_calculate = L[2:] calculations = {} for feature_name in features_to_calculate: calculations[feature_name] = {} for statistic in summary_statistics: stat_function = getattr(trd.get_feature(feature_name), statistic) calculations[feature_name][statistic] = stat_function() f = open(sess_root + '/summary_statistics.json', 'w') dump(calculations, f, indent=4) f.close()
from json import dump from src.data_interface import trd, L from src.utils import get_path sess_root = get_path(__file__) + '/../src' features_to_calculate = L[2:] unique_values = {} for feature_name in features_to_calculate: unique_values[feature_name] = trd.get_feature(feature_name).unique_values() f = open(sess_root + '/unique_values.json', 'w') dump(unique_values, f, indent=4) f.close()