Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created January 17, 2021 08:58
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/94c5712d3da525133fb458b89a7d8d69 to your computer and use it in GitHub Desktop.
Save amankharwal/94c5712d3da525133fb458b89a7d8d69 to your computer and use it in GitHub Desktop.
most_rated = df.sort_values('ratings_count', ascending = False).head(10).set_index('title')
plt.figure(figsize=(15,10))
ax = sns.barplot(most_rated['ratings_count'], most_rated.index, palette = 'inferno')
totals = []
for i in ax.patches:
totals.append(i.get_width())
total = sum(totals)
for i in ax.patches:
ax.text(i.get_width()+.2, i.get_y()+.2,str(round(i.get_width())), fontsize=15,color='black')
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment