I\'m trying to take a dataframe and transform it into a partcular json format.
Here\'s my dataframe example:
DataFrame name: Stops id location 0
You can use orient='records'
print df.reset_index().to_json(orient='records') [ {"id":0,"location":"[50, 50]"}, {"id":1,"location":"[60, 60]"}, {"id":2,"location":"[70, 70]"}, {"id":3,"location":"[80, 80]"} ]