Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created February 12, 2021 15:11
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/cc634204501522244c9f850fb2fce59f to your computer and use it in GitHub Desktop.
Save amankharwal/cc634204501522244c9f850fb2fce59f to your computer and use it in GitHub Desktop.
df.drop(df.tail(1).index, inplace = True)
df1 = df.sort_values(by='active', ascending=False)
df3 = df1[:5]
states = df3.state_name
active = df3.active
colours = ["skyblue", "blue", "purple", "yellow", "red"]
plt.figure(figsize=(7,7))
plt.pie(active, labels=states, colors=colours)
plt.rc('font', size=12)
plt.title("Top 5 Active cases", fontsize=20)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment