Python-Json数据写入与可视化

Josn写入:

priorizationTests = {}
priorizationTests["Method1"]="1,2,3,4"
with open("test.json",'w') as outfile:
    str=json.dumps(priorizationTests,indent=4)
    outfile.write(str)
    outfile.close()

Json可视化

with open("apfd_statement.json","r") as data_file:
    apfd_statement=json.load(data_file)
df = pd.DataFrame(apfd_statement)
df.plot.box(title="picture",)
plt.grid(linestyle="--", alpha=0.3)
plt.savefig("picture/test3.png",dpi=999)
plt.show()

你可能感兴趣的:(Python数据分析)