diff --git a/q4/q4_3a/q4_3.py b/q4/q4_3a/q4_3.py new file mode 100644 index 0000000..aa4f820 --- /dev/null +++ b/q4/q4_3a/q4_3.py @@ -0,0 +1,15 @@ +import json +import matplotlib.pyplot as plt + +movies = json.load(open('movies.json', encoding='utf-8'))['movies'] +# print(movies) + +ratings = [] +durations = [] +for m in movies: + ratings.append(m['rating']) + durations.append(m['duration']) + +plt.figure(figsize=(8,5)) +plt.hist(ratings, bins=5,color='blue') +plt.savefig('q4_3a_hist.png') \ No newline at end of file