Skip to content

Instantly share code, notes, and snippets.

@amankharwal

amankharwal/pie.py Secret

Created Feb 12, 2021
Embed
What would you like to do?
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