Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created February 12, 2021 15:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amankharwal/653e0fb0dbed4c6aa6444fb420f5586e to your computer and use it in GitHub Desktop.
Save amankharwal/653e0fb0dbed4c6aa6444fb420f5586e to your computer and use it in GitHub Desktop.
import pandas as pd
df = pd.read_json("datanew.json")
group_size = [sum(df.positive), sum(df.active), sum(df.cured)]
group_labels = ["Positive\n"+str(sum(df.positive)),
"Active\n"+str(sum(df.active)),
"Cured\n"+str(sum(df.cured))]
custom_colors = ["skyblue", "yellowgreen", 'tomato']
plt.figure(figsize=(5, 5))
plt.pie(group_size, labels=group_labels, colors=custom_colors)
plt.rc('font', size=12)
plt.title("Total Positive, Active, and Cured Cases", fontsize=20)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment