I have a pandas dataframe containing windows 10 logs. I want this pandas df to convert to JSON. What is an efficient way to do this?
I already made it to generate a default pandas df, however this is not nested. How I want it
{
"0": {
"ProcessName": "Firefox",
"time": "2019-07-12T00:00:00",
"timeFloat": 1562882400.0,
"internal_time": 0.0,
"counter": 0
},
"1": {
"ProcessName": "Excel",
"time": "2019-07-12T00:00:00",
"timeFloat": 1562882400.0,
"internal_time": 0.0,
"counter": 0
},
"2": {
"ProcessName": "Word",
"time": "2019-07-12T01:30:00",
"timeFloat": 1562888000.0,
"internal_time": 1.5533333333,
"counter": 0
}
I want it to look like like this
{
"0": {
"time": "2019-07-12T00:00:00",
"timeFloat": 1562882400.0,
"internal_time": 0.0,
"Processes" : {
"Firefox" : 0 # ("counter" value),
"Excel" : 0
},
"1": ...
}