repl.it
@adriculous/

Book Average Ratings and Total Number of Ratings

Python

Scatter plot based on the Goodreads dataset and API

fork
loading
Files
  • main.py
  • bookratings_scatter.png
  • books.csv
  • Packager files
  • poetry.lock
  • pyproject.toml
  • requirements.txt
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt

with open("books.csv","r") as datafile:
    data = pd.read_csv(datafile,delimiter=",")

sns.scatterplot(x="average_rating", y="ratings_count", size="ratings_count", hue="ratings_count", sizes=(20, 180), data=data)

plt.xlabel("Average Book Ratings")
plt.ylabel("Total Number of Ratings")
plt.title("Book Average Ratings and Total of Ratings")
plt.savefig("bookratings_scatter.png")
Fetching token
?