max_death_cases=today.sort_values(by=”deaths”,ascending=False)
max_death_cases
sns.set(rc={‘figure.figsize’:(15,10)})
sns.barplot(x=”state”,y=”deaths”,data=top_states_death,hue=”state”)
plt.show()
Code Explanation:
We start off by sorting our dataframe in descending order w.r.t the “deaths” column:
max_death_cases=today.sort_values(by=”deaths”,ascending=False)
Max_death_cases
Then, we go ahead and make the bar-plot with the help of seaborn library:
sns.set(rc={‘figure.figsize’:(15,10)})
sns.barplot(x=”state”,y=”deaths”,data=top_states_death,hue=”state”)
plt.show()
Here, we are mapping “state” column onto the x-axis and “deaths” column onto the y-axis.