Here is the input type, a NumPy array, like
[['id' '796132' '1148512' '87741691' '87910849' '88188296']
['diagnosis' '1' '0' '1' '0' '0']
['fractal_dimension_worst' '0.08701' '0.08006' '0.08255' '0.06484' '0.1118']]
I want to convert it to a JSON file like
{
"id": ['796132', '1148512', '87741691', '87910849', '88188296'],
"diagnosis": ['1', '0', '1', '0', '0'],
"fractal_dimension_worst": ['0.08701', '0.08006', '0.08255', '0.06484', '0.1118']
}
How to do that?
arr.tolist(). Then create the dict from that. Should be a straight forward iteration.