diff --git a/movies.html b/movies.html new file mode 100644 index 0000000..56a6460 --- /dev/null +++ b/movies.html @@ -0,0 +1,152 @@ + + + + + + + + 电影列表 + + + +

电影列表

+

数据编号:B-20260623-2673

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
编号电影名导演上映年份评分时长(分钟)类型主演数
1肖申克的救赎Frank Darabont20217.2105科幻4
2霸王别姬陈凯歌20208.2148喜剧5
3阿甘正传Robert Zemeckis19938.9169剧情4
4千与千寻James Cameron20138.290剧情3
5三傻大闹宝莱坞宫崎骏20109.3168动画2
6盗梦空间Christopher Nolan20179.4107动画5
7放牛班的春天Lasse Hallström20139.195喜剧5
8星际穿越Rajkumar Hirani20238.1163动画2
9泰坦尼克号Christophe Barratier20028.4166冒险4
10忠犬八公的故事Christopher Nolan20088.7112剧情4
+ + \ No newline at end of file diff --git a/movies.json b/movies.json new file mode 100644 index 0000000..6ffa3ad --- /dev/null +++ b/movies.json @@ -0,0 +1,102 @@ +[ + { + "id": 1, + "title": "肖申克的救赎", + "director": "Frank Darabont", + "year": 2021, + "rating": 7.2, + "duration": 105, + "genre": "科幻", + "actors_count": 4 + }, + { + "id": 2, + "title": "霸王别姬", + "director": "陈凯歌", + "year": 2020, + "rating": 8.2, + "duration": 148, + "genre": "喜剧", + "actors_count": 5 + }, + { + "id": 3, + "title": "阿甘正传", + "director": "Robert Zemeckis", + "year": 1993, + "rating": 8.9, + "duration": 169, + "genre": "剧情", + "actors_count": 4 + }, + { + "id": 4, + "title": "千与千寻", + "director": "James Cameron", + "year": 2013, + "rating": 8.2, + "duration": 90, + "genre": "剧情", + "actors_count": 3 + }, + { + "id": 5, + "title": "三傻大闹宝莱坞", + "director": "宫崎骏", + "year": 2010, + "rating": 9.3, + "duration": 168, + "genre": "动画", + "actors_count": 2 + }, + { + "id": 6, + "title": "盗梦空间", + "director": "Christopher Nolan", + "year": 2017, + "rating": 9.4, + "duration": 107, + "genre": "动画", + "actors_count": 5 + }, + { + "id": 7, + "title": "放牛班的春天", + "director": "Lasse Hallström", + "year": 2013, + "rating": 9.1, + "duration": 95, + "genre": "喜剧", + "actors_count": 5 + }, + { + "id": 8, + "title": "星际穿越", + "director": "Rajkumar Hirani", + "year": 2023, + "rating": 8.1, + "duration": 163, + "genre": "动画", + "actors_count": 2 + }, + { + "id": 9, + "title": "泰坦尼克号", + "director": "Christophe Barratier", + "year": 2002, + "rating": 8.4, + "duration": 166, + "genre": "冒险", + "actors_count": 4 + }, + { + "id": 10, + "title": "忠犬八公的故事", + "director": "Christopher Nolan", + "year": 2008, + "rating": 8.7, + "duration": 112, + "genre": "剧情", + "actors_count": 4 + } +] \ No newline at end of file diff --git a/q2_2.py b/q2_2.py new file mode 100644 index 0000000..f9eafb5 --- /dev/null +++ b/q2_2.py @@ -0,0 +1,25 @@ +import json + +with open("movies.json","r",encoding="utf‑8") as f: + data = json.load(f) + +max_m = max(data,key=lambda x:x["rating"]) +min_m = min(data,key=lambda x:x["rating"]) +print(f"评分最高:{max_m['title']} {max_m['rating']}") +print(f"评分最低:{min_m['title']} {min_m['rating']}") + +genre_count = {} +for m in data: + genre_count[m["genre"]] = genre_count.get(m["genre"],0)+1 +print(genre_count) + +dir_count = {} +for m in data: + dir_count[m["director"]] = dir_count.get(m["director"],0)+1 +print(dir_count) + +cnt = 0 +for m in data: + if m["year"] >= 2020: + cnt += 1 +print("2020年(含)以后上映电影数量:",cnt) \ No newline at end of file diff --git a/q3_1_image_labels.zip b/q3_1_image_labels.zip new file mode 100644 index 0000000..d2321d2 Binary files /dev/null and b/q3_1_image_labels.zip differ