12 lines
325 B
Python
12 lines
325 B
Python
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"]
|
|
|
|
dur = [i["duration"] for i in movies]
|
|
plt.hist(dur,edgecolor="black")
|
|
plt.xlabel("时长(分钟)")
|
|
plt.savefig("q4_3b_hist.png",dpi=150)
|
|
plt.close() |