I have the following Dataframe in python:
And I want to transform it into the the following json object so I can send it to front end and plot it on highcharts:
name: 'netflix',
data: [
[1579996800, 67],
[1580601600, 70],
[1581206400, 68],
[1581811200, 72],
etc...
]
}, {
name: 'netflix movies',
data: [
[1579996800, 59],
[1580601600, 69],
[1581206400, 71],
[1581811200, 63],
etc...
]
}]
Im using:
json = df.to_json()
But I get something very close but the date it's showing up as an index and not as a value. It's ok that shows timestamp but I want it to be [1579996800, 67] and not [1579996800: 67]
How do I get an JSON Array of objects: [ {x : x value, y: y value}, {x : x value, y: y value}, ...] from this dataframe? So I can send to the front end and plot using highcharts?
If I reset the index then everything gets messy. What would be the best way of achieving this?

