1#Lazy way to convert json dict to df
2
3pd.DataFrame.from_dict(data, orient='index').T
1#orientstr {‘dict’, ‘list’, ‘series’, ‘split’, ‘records’, ‘index’}
2#Determines the type of the values of the dictionary.
3#‘dict’ (default) : dict like {column -> {index -> value}}
4#‘list’ : dict like {column -> [values]}
5#‘series’ : dict like {column -> Series(values)}
6#‘split’ : dict like {‘index’ -> [index], ‘columns’ -> [columns], ‘data’ -> [values]}
7#‘records’ : list like [{column -> value}, … , {column -> value}]
8#‘index’ : dict like {index -> {column -> value}}
9
10# Example:
11data = pandas.read_csv("data/data_name.csv")
12to_dict = data.to_dict(orient="records")