Closed
Description
The to_json() I/O command current provides the following output:
split dict like {index -> [index], columns -> [columns], data -> [values]}
records list like [{column -> value}, ... , {column -> value}]
index dict like {index -> {column -> value}}
columns dict like {column -> {index -> value}}
values just the values array
It would be handy if the output could also be provided in the format:
mdarray [ [index1,value1a,value1b,...] , [index2,value2a,value2b,...], ... ]
This format is, for instance, used by the DyGraphs JS library for plotting data.
The following command provides the output I am looking for:
np.column_stack((df.index,df.as_matrix())).tolist()
(where df
is a DataFrame)