diff --git a/q4/q4_3a/q4_3.py b/q4/q4_3a/q4_3.py new file mode 100644 index 0000000..ec10f16 --- /dev/null +++ b/q4/q4_3a/q4_3.py @@ -0,0 +1,12 @@ +import json +import matplotlib.pyplot as plt + +with open("../q2_1_crawler/movies.json","r",encoding="utf-8") as f: + data = json.load(f) +movies = data["movies"] + +ratings = [i["rating"] for i in movies] +plt.hist(ratings,edgecolor="black") +plt.xlabel("评分") +plt.savefig("q4_3a_hist.png",dpi=150) +plt.close() \ No newline at end of file