{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "96202672", "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "import numpy as np\n", "import re\n", "import csv\n", "\n", "from bs4 import BeautifulSoup\n", "import requests\n", "import time, os \n", "import random\n", "from fake_useragent import UserAgent\n", "\n", "pd.set_option('display.max_rows', None)\n", "pd.set_option('display.max_columns', None)\n", "\n", "ua = UserAgent()\n" ] }, { "cell_type": "code", "execution_count": 2, "id": "6c513a08", "metadata": {}, "outputs": [], "source": [ "movies = pd.read_csv('./movies_2021_2017.csv')" ] }, { "cell_type": "code", "execution_count": 3, "id": "56c2e0b6", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(4452, 12)" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movies.shape" ] }, { "cell_type": "code", "execution_count": 4, "id": "4927057d", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Unnamed: 0titlemovie_idmovie_imdb_linkcertificateruntime_in_minsgenreimdb_ratingnumber_of_votesmetascoretop_directorrelease_year
44474447WHAT IF? A (Fan-Made) 'Life is Strange' Storytt7732486https://www.imdb.com/title/tt7732486/?ref_=adv...[]127Drama, Mystery5.1204[]See full summary2017
44484448Created Equaltt5873100https://www.imdb.com/title/tt5873100/?ref_=adv...TV-PG91Drama, Thriller5.5204[]Bill Duke2017
44494449Kate Can't Swimtt5752904https://www.imdb.com/title/tt5752904/?ref_=adv...[]90Drama5.5201[]Josh Helman2017
44504450Blue Hollywoodtt5588118https://www.imdb.com/title/tt5588118/?ref_=adv...[]82Comedy, Drama, Romance7.3200[]See full summary2017
44514451A Closer Walk with Theett4943620https://www.imdb.com/title/tt4943620/?ref_=adv...Unrated89Drama, Horror3.8200[]John C. Clark2017
\n", "
" ], "text/plain": [ " Unnamed: 0 title movie_id \\\n", "4447 4447 WHAT IF? A (Fan-Made) 'Life is Strange' Story tt7732486 \n", "4448 4448 Created Equal tt5873100 \n", "4449 4449 Kate Can't Swim tt5752904 \n", "4450 4450 Blue Hollywood tt5588118 \n", "4451 4451 A Closer Walk with Thee tt4943620 \n", "\n", " movie_imdb_link certificate \\\n", "4447 https://www.imdb.com/title/tt7732486/?ref_=adv... [] \n", "4448 https://www.imdb.com/title/tt5873100/?ref_=adv... TV-PG \n", "4449 https://www.imdb.com/title/tt5752904/?ref_=adv... [] \n", "4450 https://www.imdb.com/title/tt5588118/?ref_=adv... [] \n", "4451 https://www.imdb.com/title/tt4943620/?ref_=adv... Unrated \n", "\n", " runtime_in_mins genre imdb_rating number_of_votes \\\n", "4447 127 Drama, Mystery 5.1 204 \n", "4448 91 Drama, Thriller 5.5 204 \n", "4449 90 Drama 5.5 201 \n", "4450 82 Comedy, Drama, Romance 7.3 200 \n", "4451 89 Drama, Horror 3.8 200 \n", "\n", " metascore top_director release_year \n", "4447 [] See full summary 2017 \n", "4448 [] Bill Duke 2017 \n", "4449 [] Josh Helman 2017 \n", "4450 [] See full summary 2017 \n", "4451 [] John C. Clark 2017 " ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movies.tail()" ] }, { "cell_type": "code", "execution_count": 5, "id": "b74138c9", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
titlemovie_idmovie_imdb_linkcertificateruntime_in_minsgenreimdb_ratingnumber_of_votesmetascoretop_directorrelease_year
0Spider-Man: No Way Homett10872600https://www.imdb.com/title/tt10872600/?ref_=ad...PG-13148Action, Adventure, Fantasy8.373908671Jon Watts2021
1Dunett1160419https://www.imdb.com/title/tt1160419/?ref_=adv...PG-13155Action, Adventure, Drama8.062106974Denis Villeneuve2021
2Don't Look Uptt11286314https://www.imdb.com/title/tt11286314/?ref_=ad...R138Comedy, Drama, Sci-Fi7.252998149Adam McKay2021
3No Time to Diett2382320https://www.imdb.com/title/tt2382320/?ref_=adv...PG-13163Action, Adventure, Thriller7.339393068Cary Joji Fukunaga2021
4Zack Snyder's Justice Leaguett12361974https://www.imdb.com/title/tt12361974/?ref_=ad...R242Action, Adventure, Fantasy8.039350454Zack Snyder2021
\n", "
" ], "text/plain": [ " title movie_id \\\n", "0 Spider-Man: No Way Home tt10872600 \n", "1 Dune tt1160419 \n", "2 Don't Look Up tt11286314 \n", "3 No Time to Die tt2382320 \n", "4 Zack Snyder's Justice League tt12361974 \n", "\n", " movie_imdb_link certificate \\\n", "0 https://www.imdb.com/title/tt10872600/?ref_=ad... PG-13 \n", "1 https://www.imdb.com/title/tt1160419/?ref_=adv... PG-13 \n", "2 https://www.imdb.com/title/tt11286314/?ref_=ad... R \n", "3 https://www.imdb.com/title/tt2382320/?ref_=adv... PG-13 \n", "4 https://www.imdb.com/title/tt12361974/?ref_=ad... R \n", "\n", " runtime_in_mins genre imdb_rating number_of_votes \\\n", "0 148 Action, Adventure, Fantasy 8.3 739086 \n", "1 155 Action, Adventure, Drama 8.0 621069 \n", "2 138 Comedy, Drama, Sci-Fi 7.2 529981 \n", "3 163 Action, Adventure, Thriller 7.3 393930 \n", "4 242 Action, Adventure, Fantasy 8.0 393504 \n", "\n", " metascore top_director release_year \n", "0 71 Jon Watts 2021 \n", "1 74 Denis Villeneuve 2021 \n", "2 49 Adam McKay 2021 \n", "3 68 Cary Joji Fukunaga 2021 \n", "4 54 Zack Snyder 2021 " ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movies = movies.drop(['Unnamed: 0'], axis=1) \n", "movies.head()" ] }, { "cell_type": "markdown", "id": "8ebee96a", "metadata": {}, "source": [ "# A df with the awards link\n" ] }, { "cell_type": "code", "execution_count": 145, "id": "3e365318", "metadata": {}, "outputs": [], "source": [ "movie_awards_link = movies[['title', 'movie_id', 'movie_imdb_link']]" ] }, { "cell_type": "code", "execution_count": 146, "id": "1972621d", "metadata": { "scrolled": true }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/var/folders/33/p_3l01b14g96rn22vzwly2g00000gn/T/ipykernel_53513/3436540390.py:1: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame.\n", "Try using .loc[row_indexer,col_indexer] = value instead\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " movie_awards_link['awards_link'] = ''\n" ] } ], "source": [ "movie_awards_link['awards_link'] = ''" ] }, { "cell_type": "code", "execution_count": 147, "id": "d62799e7", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
titlemovie_idmovie_imdb_linkawards_link
0Spider-Man: No Way Homett10872600https://www.imdb.com/title/tt10872600/?ref_=ad...
1Dunett1160419https://www.imdb.com/title/tt1160419/?ref_=adv...
2Don't Look Uptt11286314https://www.imdb.com/title/tt11286314/?ref_=ad...
3No Time to Diett2382320https://www.imdb.com/title/tt2382320/?ref_=adv...
4Zack Snyder's Justice Leaguett12361974https://www.imdb.com/title/tt12361974/?ref_=ad...
\n", "
" ], "text/plain": [ " title movie_id \\\n", "0 Spider-Man: No Way Home tt10872600 \n", "1 Dune tt1160419 \n", "2 Don't Look Up tt11286314 \n", "3 No Time to Die tt2382320 \n", "4 Zack Snyder's Justice League tt12361974 \n", "\n", " movie_imdb_link awards_link \n", "0 https://www.imdb.com/title/tt10872600/?ref_=ad... \n", "1 https://www.imdb.com/title/tt1160419/?ref_=adv... \n", "2 https://www.imdb.com/title/tt11286314/?ref_=ad... \n", "3 https://www.imdb.com/title/tt2382320/?ref_=adv... \n", "4 https://www.imdb.com/title/tt12361974/?ref_=ad... " ] }, "execution_count": 147, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movie_awards_link.head()" ] }, { "cell_type": "code", "execution_count": 148, "id": "d8737afb", "metadata": { "scrolled": true }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/var/folders/33/p_3l01b14g96rn22vzwly2g00000gn/T/ipykernel_53513/2932944961.py:3: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " movie_awards_link['awards_link'][i] = awards_link_temp + '/awards/?ref_=tt_awd'\n" ] } ], "source": [ "for i in movie_awards_link.index:\n", " awards_link_temp = movie_awards_link['movie_imdb_link'][i].split('/?ref_=adv_li_tt')[0]\n", " movie_awards_link['awards_link'][i] = awards_link_temp + '/awards/?ref_=tt_awd'\n", " " ] }, { "cell_type": "code", "execution_count": 149, "id": "02ae6ca8", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
titlemovie_idmovie_imdb_linkawards_link
0Spider-Man: No Way Homett10872600https://www.imdb.com/title/tt10872600/?ref_=ad...https://www.imdb.com/title/tt10872600/awards/?...
1Dunett1160419https://www.imdb.com/title/tt1160419/?ref_=adv...https://www.imdb.com/title/tt1160419/awards/?r...
2Don't Look Uptt11286314https://www.imdb.com/title/tt11286314/?ref_=ad...https://www.imdb.com/title/tt11286314/awards/?...
3No Time to Diett2382320https://www.imdb.com/title/tt2382320/?ref_=adv...https://www.imdb.com/title/tt2382320/awards/?r...
4Zack Snyder's Justice Leaguett12361974https://www.imdb.com/title/tt12361974/?ref_=ad...https://www.imdb.com/title/tt12361974/awards/?...
\n", "
" ], "text/plain": [ " title movie_id \\\n", "0 Spider-Man: No Way Home tt10872600 \n", "1 Dune tt1160419 \n", "2 Don't Look Up tt11286314 \n", "3 No Time to Die tt2382320 \n", "4 Zack Snyder's Justice League tt12361974 \n", "\n", " movie_imdb_link \\\n", "0 https://www.imdb.com/title/tt10872600/?ref_=ad... \n", "1 https://www.imdb.com/title/tt1160419/?ref_=adv... \n", "2 https://www.imdb.com/title/tt11286314/?ref_=ad... \n", "3 https://www.imdb.com/title/tt2382320/?ref_=adv... \n", "4 https://www.imdb.com/title/tt12361974/?ref_=ad... \n", "\n", " awards_link \n", "0 https://www.imdb.com/title/tt10872600/awards/?... \n", "1 https://www.imdb.com/title/tt1160419/awards/?r... \n", "2 https://www.imdb.com/title/tt11286314/awards/?... \n", "3 https://www.imdb.com/title/tt2382320/awards/?r... \n", "4 https://www.imdb.com/title/tt12361974/awards/?... " ] }, "execution_count": 149, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movie_awards_link.head()\n" ] }, { "cell_type": "markdown", "id": "82a9d5ef", "metadata": {}, "source": [ "# Scraping the awards information" ] }, { "cell_type": "code", "execution_count": 25, "id": "b15ca0b2", "metadata": {}, "outputs": [], "source": [ "def scrape_awards(df):\n", " \n", " movie_awards_dict = {} #initializing an empty dictionary to fill with information\n", "\n", " for i in df.index:\n", " title = df['title'][i]\n", " movie_id = df['movie_id'][i]\n", " awards_link = df['awards_link'][i]\n", " \n", " user_agent = {'User-agent': ua.random} # generates a random user agent.\n", " response = requests.get(awards_link,headers = user_agent).text\n", " soup = BeautifulSoup(response, \"html.parser\")\n", "\n", " # awards and nominations:\n", " try:\n", " awards_total = soup.select('#main > div:nth-child(1) > div > div.header > div > div')[0].get_text()\n", " except: \n", " awards_total = 0\n", " \n", " time.sleep(.5+2*random.random()) # random time between requests.\n", " \n", " movie_awards_dict[df.index[i]] = [title]+[movie_id]+[awards_link]+[awards_total]\n", "\n", " # define headers\n", " headers = ['title','movie_id','awards_link', 'awards_total']\n", " \n", " # turn into a dataframe \n", " movie_awards_dataframe = pd.DataFrame(movie_awards_dict).T\n", " movie_awards_dataframe.columns = headers\n", " \n", " #save the dataframe\n", " #movie_awards_dataframe.to_csv('awards_2022.csv') # CHANGE THE YEAR ACC TO YOUR INTEREST\n", " \n", " return movie_awards_dataframe\n" ] }, { "cell_type": "code", "execution_count": 214, "id": "dd1f50d1", "metadata": {}, "outputs": [], "source": [ "awards_df = scrape_awards(movie_awards_link)" ] }, { "cell_type": "code", "execution_count": 215, "id": "674c75a4", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
titlemovie_idawards_linkawards_total
0Spider-Man: No Way Homett10872600https://www.imdb.com/title/tt10872600/awards/?...Showing all 34 wins and 66 nominations
1Dunett1160419https://www.imdb.com/title/tt1160419/awards/?r...Showing all 164 wins and 280 nominations
2Don't Look Uptt11286314https://www.imdb.com/title/tt11286314/awards/?...Showing all 19 wins and 88 nominations
3No Time to Diett2382320https://www.imdb.com/title/tt2382320/awards/?r...Showing all 35 wins and 69 nominations
4Zack Snyder's Justice Leaguett12361974https://www.imdb.com/title/tt12361974/awards/?...Showing all 1 win and 6 nominations
\n", "
" ], "text/plain": [ " title movie_id \\\n", "0 Spider-Man: No Way Home tt10872600 \n", "1 Dune tt1160419 \n", "2 Don't Look Up tt11286314 \n", "3 No Time to Die tt2382320 \n", "4 Zack Snyder's Justice League tt12361974 \n", "\n", " awards_link \\\n", "0 https://www.imdb.com/title/tt10872600/awards/?... \n", "1 https://www.imdb.com/title/tt1160419/awards/?r... \n", "2 https://www.imdb.com/title/tt11286314/awards/?... \n", "3 https://www.imdb.com/title/tt2382320/awards/?r... \n", "4 https://www.imdb.com/title/tt12361974/awards/?... \n", "\n", " awards_total \n", "0 Showing all 34 wins and 66 nominations \n", "1 Showing all 164 wins and 280 nominations \n", "2 Showing all 19 wins and 88 nominations \n", "3 Showing all 35 wins and 69 nominations \n", "4 Showing all 1 win and 6 nominations " ] }, "execution_count": 215, "metadata": {}, "output_type": "execute_result" } ], "source": [ "awards_df.head()" ] }, { "cell_type": "code", "execution_count": null, "id": "ca1bf690", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "id": "03301b5b", "metadata": {}, "source": [ "# Repeating everything for another dataframe" ] }, { "cell_type": "code", "execution_count": 218, "id": "19a0bb55", "metadata": {}, "outputs": [], "source": [ "movies_2016_2015 = pd.read_csv('./movies_2016_2015.csv')" ] }, { "cell_type": "code", "execution_count": 219, "id": "deb424df", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
titlemovie_idmovie_imdb_linkcertificateruntime_in_minsgenreimdb_ratingnumber_of_votesmetascoretop_directorrelease_year
1885The Haunting at Woodland Hillstt1523575https://www.imdb.com/title/tt1523575/?ref_=adv...[]84Drama, Horror, Thriller3.4201[]Jeremy Casper2016
1886Volumes of Blood: Horror Storiestt6211920https://www.imdb.com/title/tt6211920/?ref_=adv...[]118Horror3.9200[]See full summary2016
1887Game of Acestt3687118https://www.imdb.com/title/tt3687118/?ref_=adv...R97Action, Adventure, War4.2200[]Damien Lay2016
\n", "
" ], "text/plain": [ " title movie_id \\\n", "1885 The Haunting at Woodland Hills tt1523575 \n", "1886 Volumes of Blood: Horror Stories tt6211920 \n", "1887 Game of Aces tt3687118 \n", "\n", " movie_imdb_link certificate \\\n", "1885 https://www.imdb.com/title/tt1523575/?ref_=adv... [] \n", "1886 https://www.imdb.com/title/tt6211920/?ref_=adv... [] \n", "1887 https://www.imdb.com/title/tt3687118/?ref_=adv... R \n", "\n", " runtime_in_mins genre imdb_rating number_of_votes \\\n", "1885 84 Drama, Horror, Thriller 3.4 201 \n", "1886 118 Horror 3.9 200 \n", "1887 97 Action, Adventure, War 4.2 200 \n", "\n", " metascore top_director release_year \n", "1885 [] Jeremy Casper 2016 \n", "1886 [] See full summary 2016 \n", "1887 [] Damien Lay 2016 " ] }, "execution_count": 219, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movies_2016_2015 = movies_2016_2015.drop(['Unnamed: 0'], axis=1) \n", "movies_2016_2015.tail(3)" ] }, { "cell_type": "code", "execution_count": null, "id": "263d23a0", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 220, "id": "4b6dd478", "metadata": {}, "outputs": [], "source": [ "movie_awards_link_2 = movies_2016_2015[['title', 'movie_id', 'movie_imdb_link']]" ] }, { "cell_type": "code", "execution_count": 221, "id": "789480bb", "metadata": { "scrolled": true }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/var/folders/33/p_3l01b14g96rn22vzwly2g00000gn/T/ipykernel_53513/1736227159.py:1: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame.\n", "Try using .loc[row_indexer,col_indexer] = value instead\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " movie_awards_link_2['awards_link'] = ''\n" ] } ], "source": [ "movie_awards_link_2['awards_link'] = ''" ] }, { "cell_type": "code", "execution_count": 222, "id": "63c936da", "metadata": { "scrolled": true }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/var/folders/33/p_3l01b14g96rn22vzwly2g00000gn/T/ipykernel_53513/3521889068.py:3: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " movie_awards_link_2['awards_link'][i] = awards_link_temp_2 + '/awards/?ref_=tt_awd'\n" ] } ], "source": [ "for i in movie_awards_link_2.index:\n", " awards_link_temp_2 = movie_awards_link_2['movie_imdb_link'][i].split('/?ref_=adv_li_tt')[0]\n", " movie_awards_link_2['awards_link'][i] = awards_link_temp_2 + '/awards/?ref_=tt_awd'\n", " " ] }, { "cell_type": "code", "execution_count": 223, "id": "8ed04200", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
titlemovie_idmovie_imdb_linkawards_link
0Star Wars: Episode VII - The Force Awakenstt2488496https://www.imdb.com/title/tt2488496/?ref_=adv...https://www.imdb.com/title/tt2488496/awards/?r...
1Avengers: Age of Ultrontt2395427https://www.imdb.com/title/tt2395427/?ref_=adv...https://www.imdb.com/title/tt2395427/awards/?r...
2The Martiantt3659388https://www.imdb.com/title/tt3659388/?ref_=adv...https://www.imdb.com/title/tt3659388/awards/?r...
3The Revenanttt1663202https://www.imdb.com/title/tt1663202/?ref_=adv...https://www.imdb.com/title/tt1663202/awards/?r...
4Inside Outtt2096673https://www.imdb.com/title/tt2096673/?ref_=adv...https://www.imdb.com/title/tt2096673/awards/?r...
\n", "
" ], "text/plain": [ " title movie_id \\\n", "0 Star Wars: Episode VII - The Force Awakens tt2488496 \n", "1 Avengers: Age of Ultron tt2395427 \n", "2 The Martian tt3659388 \n", "3 The Revenant tt1663202 \n", "4 Inside Out tt2096673 \n", "\n", " movie_imdb_link \\\n", "0 https://www.imdb.com/title/tt2488496/?ref_=adv... \n", "1 https://www.imdb.com/title/tt2395427/?ref_=adv... \n", "2 https://www.imdb.com/title/tt3659388/?ref_=adv... \n", "3 https://www.imdb.com/title/tt1663202/?ref_=adv... \n", "4 https://www.imdb.com/title/tt2096673/?ref_=adv... \n", "\n", " awards_link \n", "0 https://www.imdb.com/title/tt2488496/awards/?r... \n", "1 https://www.imdb.com/title/tt2395427/awards/?r... \n", "2 https://www.imdb.com/title/tt3659388/awards/?r... \n", "3 https://www.imdb.com/title/tt1663202/awards/?r... \n", "4 https://www.imdb.com/title/tt2096673/awards/?r... " ] }, "execution_count": 223, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movie_awards_link_2.head()\n" ] }, { "cell_type": "code", "execution_count": 225, "id": "9ace66da", "metadata": {}, "outputs": [], "source": [ "awards_2016_2015_df = scrape_awards(movie_awards_link_2)" ] }, { "cell_type": "code", "execution_count": 226, "id": "8fa7eaec", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
titlemovie_idawards_linkawards_total
0Star Wars: Episode VII - The Force Awakenstt2488496https://www.imdb.com/title/tt2488496/awards/?r...Showing all 62 wins and 139 nominations
1Avengers: Age of Ultrontt2395427https://www.imdb.com/title/tt2395427/awards/?r...Showing all 8 wins and 51 nominations
2The Martiantt3659388https://www.imdb.com/title/tt3659388/awards/?r...Showing all 40 wins and 200 nominations
\n", "
" ], "text/plain": [ " title movie_id \\\n", "0 Star Wars: Episode VII - The Force Awakens tt2488496 \n", "1 Avengers: Age of Ultron tt2395427 \n", "2 The Martian tt3659388 \n", "\n", " awards_link \\\n", "0 https://www.imdb.com/title/tt2488496/awards/?r... \n", "1 https://www.imdb.com/title/tt2395427/awards/?r... \n", "2 https://www.imdb.com/title/tt3659388/awards/?r... \n", "\n", " awards_total \n", "0 Showing all 62 wins and 139 nominations \n", "1 Showing all 8 wins and 51 nominations \n", "2 Showing all 40 wins and 200 nominations " ] }, "execution_count": 226, "metadata": {}, "output_type": "execute_result" } ], "source": [ "awards_2016_2015_df.head(3)" ] }, { "cell_type": "markdown", "id": "8ec17eb1", "metadata": {}, "source": [ "# Validation data (year 2022)" ] }, { "cell_type": "code", "execution_count": 13, "id": "b3ea17e7", "metadata": {}, "outputs": [], "source": [ "movies_2022 = pd.read_csv('./movies_2022.csv')" ] }, { "cell_type": "code", "execution_count": 14, "id": "213dd511", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Unnamed: 0movie_idmovie_imdb_linkcertificateruntime_in_minsgenreimdb_ratingnumber_of_votesmetascoretop_directorrelease_year
472Call for Peacett19511880https://www.imdb.com/title/tt19511880/?ref_=ad...[][]Reality-TV9.1204.0[]Diane Paloma Eskenazi2022
473Do Not Disturbtt10696116https://www.imdb.com/title/tt10696116/?ref_=ad...[]92Horror7.9204.0[]John Ainslie2022
474Matilda the Musicaltt3447590https://www.imdb.com/title/tt3447590/?ref_=adv...PG117Comedy, Drama, Family6.1201.067Matthew Warchus2022
475The Haunting of the Murder Housett20861742https://www.imdb.com/title/tt20861742/?ref_=ad...[]78Horror4.5200.0[]Brendan Rudnicki2022
476Project Legiontt12885770https://www.imdb.com/title/tt12885770/?ref_=ad...R90Horror, Sci-Fi, Thriller2.2200.0[]Lance Kawas2022
\n", "
" ], "text/plain": [ " Unnamed: 0 movie_id \\\n", "472 Call for Peace tt19511880 \n", "473 Do Not Disturb tt10696116 \n", "474 Matilda the Musical tt3447590 \n", "475 The Haunting of the Murder House tt20861742 \n", "476 Project Legion tt12885770 \n", "\n", " movie_imdb_link certificate \\\n", "472 https://www.imdb.com/title/tt19511880/?ref_=ad... [] \n", "473 https://www.imdb.com/title/tt10696116/?ref_=ad... [] \n", "474 https://www.imdb.com/title/tt3447590/?ref_=adv... PG \n", "475 https://www.imdb.com/title/tt20861742/?ref_=ad... [] \n", "476 https://www.imdb.com/title/tt12885770/?ref_=ad... R \n", "\n", " runtime_in_mins genre imdb_rating number_of_votes \\\n", "472 [] Reality-TV 9.1 204.0 \n", "473 92 Horror 7.9 204.0 \n", "474 117 Comedy, Drama, Family 6.1 201.0 \n", "475 78 Horror 4.5 200.0 \n", "476 90 Horror, Sci-Fi, Thriller 2.2 200.0 \n", "\n", " metascore top_director release_year \n", "472 [] Diane Paloma Eskenazi 2022 \n", "473 [] John Ainslie 2022 \n", "474 67 Matthew Warchus 2022 \n", "475 [] Brendan Rudnicki 2022 \n", "476 [] Lance Kawas 2022 " ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movies_2022.tail()" ] }, { "cell_type": "code", "execution_count": 15, "id": "3c8b2dce", "metadata": {}, "outputs": [], "source": [ "movies_2022 = movies_2022.reset_index()\n", "movies_2022 = movies_2022.rename(columns = {'Unnamed: 0':'title'})\n" ] }, { "cell_type": "code", "execution_count": 16, "id": "af2fd151", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(477, 12)" ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movies_2022.shape" ] }, { "cell_type": "code", "execution_count": 17, "id": "dc725f35", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
indextitlemovie_idmovie_imdb_linkcertificateruntime_in_minsgenreimdb_ratingnumber_of_votesmetascoretop_directorrelease_year
00The Batmantt1877830https://www.imdb.com/title/tt1877830/?ref_=adv...PG-13176Action, Crime, Drama7.9613958.072Matt Reeves2022
11Top Gun: Mavericktt1745960https://www.imdb.com/title/tt1745960/?ref_=adv...PG-13130Action, Drama8.4413022.078Joseph Kosinski2022
22Doctor Strange in the Multiverse of Madnesstt9419884https://www.imdb.com/title/tt9419884/?ref_=adv...PG-13126Action, Adventure, Fantasy6.9398982.060Sam Raimi2022
33Thor: Love and Thundertt10648342https://www.imdb.com/title/tt10648342/?ref_=ad...PG-13118Action, Adventure, Comedy6.4296865.057Taika Waititi2022
44Everything Everywhere All at Oncett6710474https://www.imdb.com/title/tt6710474/?ref_=adv...R139Action, Adventure, Comedy8.1228555.081Dan Kwan2022
\n", "
" ], "text/plain": [ " index title movie_id \\\n", "0 0 The Batman tt1877830 \n", "1 1 Top Gun: Maverick tt1745960 \n", "2 2 Doctor Strange in the Multiverse of Madness tt9419884 \n", "3 3 Thor: Love and Thunder tt10648342 \n", "4 4 Everything Everywhere All at Once tt6710474 \n", "\n", " movie_imdb_link certificate \\\n", "0 https://www.imdb.com/title/tt1877830/?ref_=adv... PG-13 \n", "1 https://www.imdb.com/title/tt1745960/?ref_=adv... PG-13 \n", "2 https://www.imdb.com/title/tt9419884/?ref_=adv... PG-13 \n", "3 https://www.imdb.com/title/tt10648342/?ref_=ad... PG-13 \n", "4 https://www.imdb.com/title/tt6710474/?ref_=adv... R \n", "\n", " runtime_in_mins genre imdb_rating number_of_votes \\\n", "0 176 Action, Crime, Drama 7.9 613958.0 \n", "1 130 Action, Drama 8.4 413022.0 \n", "2 126 Action, Adventure, Fantasy 6.9 398982.0 \n", "3 118 Action, Adventure, Comedy 6.4 296865.0 \n", "4 139 Action, Adventure, Comedy 8.1 228555.0 \n", "\n", " metascore top_director release_year \n", "0 72 Matt Reeves 2022 \n", "1 78 Joseph Kosinski 2022 \n", "2 60 Sam Raimi 2022 \n", "3 57 Taika Waititi 2022 \n", "4 81 Dan Kwan 2022 " ] }, "execution_count": 17, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movies_2022.head()" ] }, { "cell_type": "code", "execution_count": 19, "id": "b467a05b", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
titlemovie_idmovie_imdb_linkcertificateruntime_in_minsgenreimdb_ratingnumber_of_votesmetascoretop_directorrelease_year
0The Batmantt1877830https://www.imdb.com/title/tt1877830/?ref_=adv...PG-13176Action, Crime, Drama7.9613958.072Matt Reeves2022
1Top Gun: Mavericktt1745960https://www.imdb.com/title/tt1745960/?ref_=adv...PG-13130Action, Drama8.4413022.078Joseph Kosinski2022
2Doctor Strange in the Multiverse of Madnesstt9419884https://www.imdb.com/title/tt9419884/?ref_=adv...PG-13126Action, Adventure, Fantasy6.9398982.060Sam Raimi2022
3Thor: Love and Thundertt10648342https://www.imdb.com/title/tt10648342/?ref_=ad...PG-13118Action, Adventure, Comedy6.4296865.057Taika Waititi2022
4Everything Everywhere All at Oncett6710474https://www.imdb.com/title/tt6710474/?ref_=adv...R139Action, Adventure, Comedy8.1228555.081Dan Kwan2022
\n", "
" ], "text/plain": [ " title movie_id \\\n", "0 The Batman tt1877830 \n", "1 Top Gun: Maverick tt1745960 \n", "2 Doctor Strange in the Multiverse of Madness tt9419884 \n", "3 Thor: Love and Thunder tt10648342 \n", "4 Everything Everywhere All at Once tt6710474 \n", "\n", " movie_imdb_link certificate \\\n", "0 https://www.imdb.com/title/tt1877830/?ref_=adv... PG-13 \n", "1 https://www.imdb.com/title/tt1745960/?ref_=adv... PG-13 \n", "2 https://www.imdb.com/title/tt9419884/?ref_=adv... PG-13 \n", "3 https://www.imdb.com/title/tt10648342/?ref_=ad... PG-13 \n", "4 https://www.imdb.com/title/tt6710474/?ref_=adv... R \n", "\n", " runtime_in_mins genre imdb_rating number_of_votes \\\n", "0 176 Action, Crime, Drama 7.9 613958.0 \n", "1 130 Action, Drama 8.4 413022.0 \n", "2 126 Action, Adventure, Fantasy 6.9 398982.0 \n", "3 118 Action, Adventure, Comedy 6.4 296865.0 \n", "4 139 Action, Adventure, Comedy 8.1 228555.0 \n", "\n", " metascore top_director release_year \n", "0 72 Matt Reeves 2022 \n", "1 78 Joseph Kosinski 2022 \n", "2 60 Sam Raimi 2022 \n", "3 57 Taika Waititi 2022 \n", "4 81 Dan Kwan 2022 " ] }, "execution_count": 19, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movies_2022 = movies_2022.drop(['index'], axis=1) \n", "movies_2022.head()" ] }, { "cell_type": "code", "execution_count": 20, "id": "246401cb", "metadata": {}, "outputs": [], "source": [ "movie_awards_link_2022 = movies_2022[['title', 'movie_id', 'movie_imdb_link']]" ] }, { "cell_type": "code", "execution_count": 21, "id": "5accd1ae", "metadata": { "scrolled": true }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/var/folders/33/p_3l01b14g96rn22vzwly2g00000gn/T/ipykernel_61402/3446922147.py:1: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame.\n", "Try using .loc[row_indexer,col_indexer] = value instead\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " movie_awards_link_2022['awards_link'] = ''\n" ] } ], "source": [ "movie_awards_link_2022['awards_link'] = ''" ] }, { "cell_type": "code", "execution_count": 22, "id": "6bfa3c64", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
titlemovie_idmovie_imdb_linkawards_link
0The Batmantt1877830https://www.imdb.com/title/tt1877830/?ref_=adv...
1Top Gun: Mavericktt1745960https://www.imdb.com/title/tt1745960/?ref_=adv...
2Doctor Strange in the Multiverse of Madnesstt9419884https://www.imdb.com/title/tt9419884/?ref_=adv...
3Thor: Love and Thundertt10648342https://www.imdb.com/title/tt10648342/?ref_=ad...
4Everything Everywhere All at Oncett6710474https://www.imdb.com/title/tt6710474/?ref_=adv...
\n", "
" ], "text/plain": [ " title movie_id \\\n", "0 The Batman tt1877830 \n", "1 Top Gun: Maverick tt1745960 \n", "2 Doctor Strange in the Multiverse of Madness tt9419884 \n", "3 Thor: Love and Thunder tt10648342 \n", "4 Everything Everywhere All at Once tt6710474 \n", "\n", " movie_imdb_link awards_link \n", "0 https://www.imdb.com/title/tt1877830/?ref_=adv... \n", "1 https://www.imdb.com/title/tt1745960/?ref_=adv... \n", "2 https://www.imdb.com/title/tt9419884/?ref_=adv... \n", "3 https://www.imdb.com/title/tt10648342/?ref_=ad... \n", "4 https://www.imdb.com/title/tt6710474/?ref_=adv... " ] }, "execution_count": 22, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movie_awards_link_2022.head()" ] }, { "cell_type": "code", "execution_count": 23, "id": "2795a252", "metadata": { "scrolled": true }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/var/folders/33/p_3l01b14g96rn22vzwly2g00000gn/T/ipykernel_61402/3228027479.py:3: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " movie_awards_link_2022['awards_link'][i] = awards_link_temp_2022 + '/awards/?ref_=tt_awd'\n" ] } ], "source": [ "for i in movie_awards_link_2022.index:\n", " awards_link_temp_2022 = movie_awards_link_2022['movie_imdb_link'][i].split('/?ref_=adv_li_tt')[0]\n", " movie_awards_link_2022['awards_link'][i] = awards_link_temp_2022 + '/awards/?ref_=tt_awd'\n", " " ] }, { "cell_type": "code", "execution_count": 24, "id": "cecc4490", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
titlemovie_idmovie_imdb_linkawards_link
0The Batmantt1877830https://www.imdb.com/title/tt1877830/?ref_=adv...https://www.imdb.com/title/tt1877830/awards/?r...
1Top Gun: Mavericktt1745960https://www.imdb.com/title/tt1745960/?ref_=adv...https://www.imdb.com/title/tt1745960/awards/?r...
2Doctor Strange in the Multiverse of Madnesstt9419884https://www.imdb.com/title/tt9419884/?ref_=adv...https://www.imdb.com/title/tt9419884/awards/?r...
3Thor: Love and Thundertt10648342https://www.imdb.com/title/tt10648342/?ref_=ad...https://www.imdb.com/title/tt10648342/awards/?...
4Everything Everywhere All at Oncett6710474https://www.imdb.com/title/tt6710474/?ref_=adv...https://www.imdb.com/title/tt6710474/awards/?r...
\n", "
" ], "text/plain": [ " title movie_id \\\n", "0 The Batman tt1877830 \n", "1 Top Gun: Maverick tt1745960 \n", "2 Doctor Strange in the Multiverse of Madness tt9419884 \n", "3 Thor: Love and Thunder tt10648342 \n", "4 Everything Everywhere All at Once tt6710474 \n", "\n", " movie_imdb_link \\\n", "0 https://www.imdb.com/title/tt1877830/?ref_=adv... \n", "1 https://www.imdb.com/title/tt1745960/?ref_=adv... \n", "2 https://www.imdb.com/title/tt9419884/?ref_=adv... \n", "3 https://www.imdb.com/title/tt10648342/?ref_=ad... \n", "4 https://www.imdb.com/title/tt6710474/?ref_=adv... \n", "\n", " awards_link \n", "0 https://www.imdb.com/title/tt1877830/awards/?r... \n", "1 https://www.imdb.com/title/tt1745960/awards/?r... \n", "2 https://www.imdb.com/title/tt9419884/awards/?r... \n", "3 https://www.imdb.com/title/tt10648342/awards/?... \n", "4 https://www.imdb.com/title/tt6710474/awards/?r... " ] }, "execution_count": 24, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movie_awards_link_2022.head()\n" ] }, { "cell_type": "code", "execution_count": 26, "id": "1a9280e3", "metadata": {}, "outputs": [], "source": [ "awards_2022_df = scrape_awards(movie_awards_link_2022)" ] }, { "cell_type": "code", "execution_count": 27, "id": "3a0d4048", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
titlemovie_idawards_linkawards_total
0The Batmantt1877830https://www.imdb.com/title/tt1877830/awards/?r...Showing all 2 wins and 27 nominations
1Top Gun: Mavericktt1745960https://www.imdb.com/title/tt1745960/awards/?r...Showing all 2 wins and 10 nominations
2Doctor Strange in the Multiverse of Madnesstt9419884https://www.imdb.com/title/tt9419884/awards/?r...Showing all 0 wins and 8 nominations
3Thor: Love and Thundertt10648342https://www.imdb.com/title/tt10648342/awards/?...Showing all 0 wins and 6 nominations
4Everything Everywhere All at Oncett6710474https://www.imdb.com/title/tt6710474/awards/?r...Showing all 10 wins and 14 nominations
\n", "
" ], "text/plain": [ " title movie_id \\\n", "0 The Batman tt1877830 \n", "1 Top Gun: Maverick tt1745960 \n", "2 Doctor Strange in the Multiverse of Madness tt9419884 \n", "3 Thor: Love and Thunder tt10648342 \n", "4 Everything Everywhere All at Once tt6710474 \n", "\n", " awards_link \\\n", "0 https://www.imdb.com/title/tt1877830/awards/?r... \n", "1 https://www.imdb.com/title/tt1745960/awards/?r... \n", "2 https://www.imdb.com/title/tt9419884/awards/?r... \n", "3 https://www.imdb.com/title/tt10648342/awards/?... \n", "4 https://www.imdb.com/title/tt6710474/awards/?r... \n", "\n", " awards_total \n", "0 Showing all 2 wins and 27 nominations \n", "1 Showing all 2 wins and 10 nominations \n", "2 Showing all 0 wins and 8 nominations \n", "3 Showing all 0 wins and 6 nominations \n", "4 Showing all 10 wins and 14 nominations " ] }, "execution_count": 27, "metadata": {}, "output_type": "execute_result" } ], "source": [ "awards_2022_df.head()" ] }, { "cell_type": "code", "execution_count": null, "id": "57941250", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.12" }, "toc": { "base_numbering": 1, "nav_menu": {}, "number_sections": true, "sideBar": true, "skip_h1_title": false, "title_cell": "Table of Contents", "title_sidebar": "Contents", "toc_cell": false, "toc_position": {}, "toc_section_display": true, "toc_window_display": false } }, "nbformat": 4, "nbformat_minor": 5 }