I am visualising the json data using mathplotlib and pandas
{
"data_point": 0,
"Add": 2977780,
"Add_num": 38595
},
{
"data_point": 1,
"Add": 2809086,
"Add_num": 36534
},
{
"data_point": 2,
"Add": 2825428,
"Add_num": 36534
},
{
"data_point": 3,
"Add": 2826861,
"Add_num": 36564
}]
This is the data now i want to draw a graph with y-axis as value obtained from division of "Add" and "Add_num" (Add/Add_num) and "data_point" as x-axis. Is there a way to do this in python code or I need to process json data to add Add_avg field in json file(i.e. Add_avg = Add/Add_num)
Code to draw the graph
import json
import pandas as pd
a_file = open("./data.json", "r")
json_object = json.load(a_file)
a_file.close()
df = pd.DataFrame(json_object)
df.plot(x='data_point', y='Add',color='maroon', marker='o')
df.plot(x='data_point', y='Add_num',color='maroon', marker='o')