{ "cells": [ { "cell_type": "code", "execution_count": 4, "id": "78a80151", "metadata": {}, "outputs": [], "source": [ "import numpy as np \n", "import pandas as pd \n", "movies = pd.read_csv('tmdb_5000_movies.csv')\n", "credits = pd.read_csv('tmdb_5000_credits.csv')" ] }, { "cell_type": "code", "execution_count": 5, "id": "55b6d11e", "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", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
budgetgenreshomepageidkeywordsoriginal_languageoriginal_titleoverviewpopularityproduction_companiesproduction_countriesrelease_daterevenueruntimespoken_languagesstatustaglinetitlevote_averagevote_count
0237000000[{\"id\": 28, \"name\": \"Action\"}, {\"id\": 12, \"nam...http://www.avatarmovie.com/19995[{\"id\": 1463, \"name\": \"culture clash\"}, {\"id\":...enAvatarIn the 22nd century, a paraplegic Marine is di...150.437577[{\"name\": \"Ingenious Film Partners\", \"id\": 289...[{\"iso_3166_1\": \"US\", \"name\": \"United States o...2009-12-102787965087162.0[{\"iso_639_1\": \"en\", \"name\": \"English\"}, {\"iso...ReleasedEnter the World of Pandora.Avatar7.211800
1300000000[{\"id\": 12, \"name\": \"Adventure\"}, {\"id\": 14, \"...http://disney.go.com/disneypictures/pirates/285[{\"id\": 270, \"name\": \"ocean\"}, {\"id\": 726, \"na...enPirates of the Caribbean: At World's EndCaptain Barbossa, long believed to be dead, ha...139.082615[{\"name\": \"Walt Disney Pictures\", \"id\": 2}, {\"...[{\"iso_3166_1\": \"US\", \"name\": \"United States o...2007-05-19961000000169.0[{\"iso_639_1\": \"en\", \"name\": \"English\"}]ReleasedAt the end of the world, the adventure begins.Pirates of the Caribbean: At World's End6.94500
2245000000[{\"id\": 28, \"name\": \"Action\"}, {\"id\": 12, \"nam...http://www.sonypictures.com/movies/spectre/206647[{\"id\": 470, \"name\": \"spy\"}, {\"id\": 818, \"name...enSpectreA cryptic message from Bond’s past sends him o...107.376788[{\"name\": \"Columbia Pictures\", \"id\": 5}, {\"nam...[{\"iso_3166_1\": \"GB\", \"name\": \"United Kingdom\"...2015-10-26880674609148.0[{\"iso_639_1\": \"fr\", \"name\": \"Fran\\u00e7ais\"},...ReleasedA Plan No One EscapesSpectre6.34466
3250000000[{\"id\": 28, \"name\": \"Action\"}, {\"id\": 80, \"nam...http://www.thedarkknightrises.com/49026[{\"id\": 849, \"name\": \"dc comics\"}, {\"id\": 853,...enThe Dark Knight RisesFollowing the death of District Attorney Harve...112.312950[{\"name\": \"Legendary Pictures\", \"id\": 923}, {\"...[{\"iso_3166_1\": \"US\", \"name\": \"United States o...2012-07-161084939099165.0[{\"iso_639_1\": \"en\", \"name\": \"English\"}]ReleasedThe Legend EndsThe Dark Knight Rises7.69106
4260000000[{\"id\": 28, \"name\": \"Action\"}, {\"id\": 12, \"nam...http://movies.disney.com/john-carter49529[{\"id\": 818, \"name\": \"based on novel\"}, {\"id\":...enJohn CarterJohn Carter is a war-weary, former military ca...43.926995[{\"name\": \"Walt Disney Pictures\", \"id\": 2}][{\"iso_3166_1\": \"US\", \"name\": \"United States o...2012-03-07284139100132.0[{\"iso_639_1\": \"en\", \"name\": \"English\"}]ReleasedLost in our world, found in another.John Carter6.12124
\n", "
" ], "text/plain": [ " budget genres \\\n", "0 237000000 [{\"id\": 28, \"name\": \"Action\"}, {\"id\": 12, \"nam... \n", "1 300000000 [{\"id\": 12, \"name\": \"Adventure\"}, {\"id\": 14, \"... \n", "2 245000000 [{\"id\": 28, \"name\": \"Action\"}, {\"id\": 12, \"nam... \n", "3 250000000 [{\"id\": 28, \"name\": \"Action\"}, {\"id\": 80, \"nam... \n", "4 260000000 [{\"id\": 28, \"name\": \"Action\"}, {\"id\": 12, \"nam... \n", "\n", " homepage id \\\n", "0 http://www.avatarmovie.com/ 19995 \n", "1 http://disney.go.com/disneypictures/pirates/ 285 \n", "2 http://www.sonypictures.com/movies/spectre/ 206647 \n", "3 http://www.thedarkknightrises.com/ 49026 \n", "4 http://movies.disney.com/john-carter 49529 \n", "\n", " keywords original_language \\\n", "0 [{\"id\": 1463, \"name\": \"culture clash\"}, {\"id\":... en \n", "1 [{\"id\": 270, \"name\": \"ocean\"}, {\"id\": 726, \"na... en \n", "2 [{\"id\": 470, \"name\": \"spy\"}, {\"id\": 818, \"name... en \n", "3 [{\"id\": 849, \"name\": \"dc comics\"}, {\"id\": 853,... en \n", "4 [{\"id\": 818, \"name\": \"based on novel\"}, {\"id\":... en \n", "\n", " original_title \\\n", "0 Avatar \n", "1 Pirates of the Caribbean: At World's End \n", "2 Spectre \n", "3 The Dark Knight Rises \n", "4 John Carter \n", "\n", " overview popularity \\\n", "0 In the 22nd century, a paraplegic Marine is di... 150.437577 \n", "1 Captain Barbossa, long believed to be dead, ha... 139.082615 \n", "2 A cryptic message from Bond’s past sends him o... 107.376788 \n", "3 Following the death of District Attorney Harve... 112.312950 \n", "4 John Carter is a war-weary, former military ca... 43.926995 \n", "\n", " production_companies \\\n", "0 [{\"name\": \"Ingenious Film Partners\", \"id\": 289... \n", "1 [{\"name\": \"Walt Disney Pictures\", \"id\": 2}, {\"... \n", "2 [{\"name\": \"Columbia Pictures\", \"id\": 5}, {\"nam... \n", "3 [{\"name\": \"Legendary Pictures\", \"id\": 923}, {\"... \n", "4 [{\"name\": \"Walt Disney Pictures\", \"id\": 2}] \n", "\n", " production_countries release_date revenue \\\n", "0 [{\"iso_3166_1\": \"US\", \"name\": \"United States o... 2009-12-10 2787965087 \n", "1 [{\"iso_3166_1\": \"US\", \"name\": \"United States o... 2007-05-19 961000000 \n", "2 [{\"iso_3166_1\": \"GB\", \"name\": \"United Kingdom\"... 2015-10-26 880674609 \n", "3 [{\"iso_3166_1\": \"US\", \"name\": \"United States o... 2012-07-16 1084939099 \n", "4 [{\"iso_3166_1\": \"US\", \"name\": \"United States o... 2012-03-07 284139100 \n", "\n", " runtime spoken_languages status \\\n", "0 162.0 [{\"iso_639_1\": \"en\", \"name\": \"English\"}, {\"iso... Released \n", "1 169.0 [{\"iso_639_1\": \"en\", \"name\": \"English\"}] Released \n", "2 148.0 [{\"iso_639_1\": \"fr\", \"name\": \"Fran\\u00e7ais\"},... Released \n", "3 165.0 [{\"iso_639_1\": \"en\", \"name\": \"English\"}] Released \n", "4 132.0 [{\"iso_639_1\": \"en\", \"name\": \"English\"}] Released \n", "\n", " tagline \\\n", "0 Enter the World of Pandora. \n", "1 At the end of the world, the adventure begins. \n", "2 A Plan No One Escapes \n", "3 The Legend Ends \n", "4 Lost in our world, found in another. \n", "\n", " title vote_average vote_count \n", "0 Avatar 7.2 11800 \n", "1 Pirates of the Caribbean: At World's End 6.9 4500 \n", "2 Spectre 6.3 4466 \n", "3 The Dark Knight Rises 7.6 9106 \n", "4 John Carter 6.1 2124 " ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movies.head()" ] }, { "cell_type": "code", "execution_count": 6, "id": "91d06a1c", "metadata": {}, "outputs": [], "source": [ "movies = movies.merge(credits, on='title')" ] }, { "cell_type": "code", "execution_count": 7, "id": "0dbe9b87", "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", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
budgetgenreshomepageidkeywordsoriginal_languageoriginal_titleoverviewpopularityproduction_companies...runtimespoken_languagesstatustaglinetitlevote_averagevote_countmovie_idcastcrew
0237000000[{\"id\": 28, \"name\": \"Action\"}, {\"id\": 12, \"nam...http://www.avatarmovie.com/19995[{\"id\": 1463, \"name\": \"culture clash\"}, {\"id\":...enAvatarIn the 22nd century, a paraplegic Marine is di...150.437577[{\"name\": \"Ingenious Film Partners\", \"id\": 289......162.0[{\"iso_639_1\": \"en\", \"name\": \"English\"}, {\"iso...ReleasedEnter the World of Pandora.Avatar7.21180019995[{\"cast_id\": 242, \"character\": \"Jake Sully\", \"...[{\"credit_id\": \"52fe48009251416c750aca23\", \"de...
1300000000[{\"id\": 12, \"name\": \"Adventure\"}, {\"id\": 14, \"...http://disney.go.com/disneypictures/pirates/285[{\"id\": 270, \"name\": \"ocean\"}, {\"id\": 726, \"na...enPirates of the Caribbean: At World's EndCaptain Barbossa, long believed to be dead, ha...139.082615[{\"name\": \"Walt Disney Pictures\", \"id\": 2}, {\"......169.0[{\"iso_639_1\": \"en\", \"name\": \"English\"}]ReleasedAt the end of the world, the adventure begins.Pirates of the Caribbean: At World's End6.94500285[{\"cast_id\": 4, \"character\": \"Captain Jack Spa...[{\"credit_id\": \"52fe4232c3a36847f800b579\", \"de...
2245000000[{\"id\": 28, \"name\": \"Action\"}, {\"id\": 12, \"nam...http://www.sonypictures.com/movies/spectre/206647[{\"id\": 470, \"name\": \"spy\"}, {\"id\": 818, \"name...enSpectreA cryptic message from Bond’s past sends him o...107.376788[{\"name\": \"Columbia Pictures\", \"id\": 5}, {\"nam......148.0[{\"iso_639_1\": \"fr\", \"name\": \"Fran\\u00e7ais\"},...ReleasedA Plan No One EscapesSpectre6.34466206647[{\"cast_id\": 1, \"character\": \"James Bond\", \"cr...[{\"credit_id\": \"54805967c3a36829b5002c41\", \"de...
3250000000[{\"id\": 28, \"name\": \"Action\"}, {\"id\": 80, \"nam...http://www.thedarkknightrises.com/49026[{\"id\": 849, \"name\": \"dc comics\"}, {\"id\": 853,...enThe Dark Knight RisesFollowing the death of District Attorney Harve...112.312950[{\"name\": \"Legendary Pictures\", \"id\": 923}, {\"......165.0[{\"iso_639_1\": \"en\", \"name\": \"English\"}]ReleasedThe Legend EndsThe Dark Knight Rises7.6910649026[{\"cast_id\": 2, \"character\": \"Bruce Wayne / Ba...[{\"credit_id\": \"52fe4781c3a36847f81398c3\", \"de...
4260000000[{\"id\": 28, \"name\": \"Action\"}, {\"id\": 12, \"nam...http://movies.disney.com/john-carter49529[{\"id\": 818, \"name\": \"based on novel\"}, {\"id\":...enJohn CarterJohn Carter is a war-weary, former military ca...43.926995[{\"name\": \"Walt Disney Pictures\", \"id\": 2}]...132.0[{\"iso_639_1\": \"en\", \"name\": \"English\"}]ReleasedLost in our world, found in another.John Carter6.1212449529[{\"cast_id\": 5, \"character\": \"John Carter\", \"c...[{\"credit_id\": \"52fe479ac3a36847f813eaa3\", \"de...
\n", "

5 rows × 23 columns

\n", "
" ], "text/plain": [ " budget genres \\\n", "0 237000000 [{\"id\": 28, \"name\": \"Action\"}, {\"id\": 12, \"nam... \n", "1 300000000 [{\"id\": 12, \"name\": \"Adventure\"}, {\"id\": 14, \"... \n", "2 245000000 [{\"id\": 28, \"name\": \"Action\"}, {\"id\": 12, \"nam... \n", "3 250000000 [{\"id\": 28, \"name\": \"Action\"}, {\"id\": 80, \"nam... \n", "4 260000000 [{\"id\": 28, \"name\": \"Action\"}, {\"id\": 12, \"nam... \n", "\n", " homepage id \\\n", "0 http://www.avatarmovie.com/ 19995 \n", "1 http://disney.go.com/disneypictures/pirates/ 285 \n", "2 http://www.sonypictures.com/movies/spectre/ 206647 \n", "3 http://www.thedarkknightrises.com/ 49026 \n", "4 http://movies.disney.com/john-carter 49529 \n", "\n", " keywords original_language \\\n", "0 [{\"id\": 1463, \"name\": \"culture clash\"}, {\"id\":... en \n", "1 [{\"id\": 270, \"name\": \"ocean\"}, {\"id\": 726, \"na... en \n", "2 [{\"id\": 470, \"name\": \"spy\"}, {\"id\": 818, \"name... en \n", "3 [{\"id\": 849, \"name\": \"dc comics\"}, {\"id\": 853,... en \n", "4 [{\"id\": 818, \"name\": \"based on novel\"}, {\"id\":... en \n", "\n", " original_title \\\n", "0 Avatar \n", "1 Pirates of the Caribbean: At World's End \n", "2 Spectre \n", "3 The Dark Knight Rises \n", "4 John Carter \n", "\n", " overview popularity \\\n", "0 In the 22nd century, a paraplegic Marine is di... 150.437577 \n", "1 Captain Barbossa, long believed to be dead, ha... 139.082615 \n", "2 A cryptic message from Bond’s past sends him o... 107.376788 \n", "3 Following the death of District Attorney Harve... 112.312950 \n", "4 John Carter is a war-weary, former military ca... 43.926995 \n", "\n", " production_companies ... runtime \\\n", "0 [{\"name\": \"Ingenious Film Partners\", \"id\": 289... ... 162.0 \n", "1 [{\"name\": \"Walt Disney Pictures\", \"id\": 2}, {\"... ... 169.0 \n", "2 [{\"name\": \"Columbia Pictures\", \"id\": 5}, {\"nam... ... 148.0 \n", "3 [{\"name\": \"Legendary Pictures\", \"id\": 923}, {\"... ... 165.0 \n", "4 [{\"name\": \"Walt Disney Pictures\", \"id\": 2}] ... 132.0 \n", "\n", " spoken_languages status \\\n", "0 [{\"iso_639_1\": \"en\", \"name\": \"English\"}, {\"iso... Released \n", "1 [{\"iso_639_1\": \"en\", \"name\": \"English\"}] Released \n", "2 [{\"iso_639_1\": \"fr\", \"name\": \"Fran\\u00e7ais\"},... Released \n", "3 [{\"iso_639_1\": \"en\", \"name\": \"English\"}] Released \n", "4 [{\"iso_639_1\": \"en\", \"name\": \"English\"}] Released \n", "\n", " tagline \\\n", "0 Enter the World of Pandora. \n", "1 At the end of the world, the adventure begins. \n", "2 A Plan No One Escapes \n", "3 The Legend Ends \n", "4 Lost in our world, found in another. \n", "\n", " title vote_average vote_count movie_id \\\n", "0 Avatar 7.2 11800 19995 \n", "1 Pirates of the Caribbean: At World's End 6.9 4500 285 \n", "2 Spectre 6.3 4466 206647 \n", "3 The Dark Knight Rises 7.6 9106 49026 \n", "4 John Carter 6.1 2124 49529 \n", "\n", " cast \\\n", "0 [{\"cast_id\": 242, \"character\": \"Jake Sully\", \"... \n", "1 [{\"cast_id\": 4, \"character\": \"Captain Jack Spa... \n", "2 [{\"cast_id\": 1, \"character\": \"James Bond\", \"cr... \n", "3 [{\"cast_id\": 2, \"character\": \"Bruce Wayne / Ba... \n", "4 [{\"cast_id\": 5, \"character\": \"John Carter\", \"c... \n", "\n", " crew \n", "0 [{\"credit_id\": \"52fe48009251416c750aca23\", \"de... \n", "1 [{\"credit_id\": \"52fe4232c3a36847f800b579\", \"de... \n", "2 [{\"credit_id\": \"54805967c3a36829b5002c41\", \"de... \n", "3 [{\"credit_id\": \"52fe4781c3a36847f81398c3\", \"de... \n", "4 [{\"credit_id\": \"52fe479ac3a36847f813eaa3\", \"de... \n", "\n", "[5 rows x 23 columns]" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movies.head()" ] }, { "cell_type": "code", "execution_count": 8, "id": "2bee3cca", "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", "
movie_idtitleoverviewgenreskeywordscastcrew
019995AvatarIn the 22nd century, a paraplegic Marine is di...[{\"id\": 28, \"name\": \"Action\"}, {\"id\": 12, \"nam...[{\"id\": 1463, \"name\": \"culture clash\"}, {\"id\":...[{\"cast_id\": 242, \"character\": \"Jake Sully\", \"...[{\"credit_id\": \"52fe48009251416c750aca23\", \"de...
1285Pirates of the Caribbean: At World's EndCaptain Barbossa, long believed to be dead, ha...[{\"id\": 12, \"name\": \"Adventure\"}, {\"id\": 14, \"...[{\"id\": 270, \"name\": \"ocean\"}, {\"id\": 726, \"na...[{\"cast_id\": 4, \"character\": \"Captain Jack Spa...[{\"credit_id\": \"52fe4232c3a36847f800b579\", \"de...
2206647SpectreA cryptic message from Bond’s past sends him o...[{\"id\": 28, \"name\": \"Action\"}, {\"id\": 12, \"nam...[{\"id\": 470, \"name\": \"spy\"}, {\"id\": 818, \"name...[{\"cast_id\": 1, \"character\": \"James Bond\", \"cr...[{\"credit_id\": \"54805967c3a36829b5002c41\", \"de...
349026The Dark Knight RisesFollowing the death of District Attorney Harve...[{\"id\": 28, \"name\": \"Action\"}, {\"id\": 80, \"nam...[{\"id\": 849, \"name\": \"dc comics\"}, {\"id\": 853,...[{\"cast_id\": 2, \"character\": \"Bruce Wayne / Ba...[{\"credit_id\": \"52fe4781c3a36847f81398c3\", \"de...
449529John CarterJohn Carter is a war-weary, former military ca...[{\"id\": 28, \"name\": \"Action\"}, {\"id\": 12, \"nam...[{\"id\": 818, \"name\": \"based on novel\"}, {\"id\":...[{\"cast_id\": 5, \"character\": \"John Carter\", \"c...[{\"credit_id\": \"52fe479ac3a36847f813eaa3\", \"de...
\n", "
" ], "text/plain": [ " movie_id title \\\n", "0 19995 Avatar \n", "1 285 Pirates of the Caribbean: At World's End \n", "2 206647 Spectre \n", "3 49026 The Dark Knight Rises \n", "4 49529 John Carter \n", "\n", " overview \\\n", "0 In the 22nd century, a paraplegic Marine is di... \n", "1 Captain Barbossa, long believed to be dead, ha... \n", "2 A cryptic message from Bond’s past sends him o... \n", "3 Following the death of District Attorney Harve... \n", "4 John Carter is a war-weary, former military ca... \n", "\n", " genres \\\n", "0 [{\"id\": 28, \"name\": \"Action\"}, {\"id\": 12, \"nam... \n", "1 [{\"id\": 12, \"name\": \"Adventure\"}, {\"id\": 14, \"... \n", "2 [{\"id\": 28, \"name\": \"Action\"}, {\"id\": 12, \"nam... \n", "3 [{\"id\": 28, \"name\": \"Action\"}, {\"id\": 80, \"nam... \n", "4 [{\"id\": 28, \"name\": \"Action\"}, {\"id\": 12, \"nam... \n", "\n", " keywords \\\n", "0 [{\"id\": 1463, \"name\": \"culture clash\"}, {\"id\":... \n", "1 [{\"id\": 270, \"name\": \"ocean\"}, {\"id\": 726, \"na... \n", "2 [{\"id\": 470, \"name\": \"spy\"}, {\"id\": 818, \"name... \n", "3 [{\"id\": 849, \"name\": \"dc comics\"}, {\"id\": 853,... \n", "4 [{\"id\": 818, \"name\": \"based on novel\"}, {\"id\":... \n", "\n", " cast \\\n", "0 [{\"cast_id\": 242, \"character\": \"Jake Sully\", \"... \n", "1 [{\"cast_id\": 4, \"character\": \"Captain Jack Spa... \n", "2 [{\"cast_id\": 1, \"character\": \"James Bond\", \"cr... \n", "3 [{\"cast_id\": 2, \"character\": \"Bruce Wayne / Ba... \n", "4 [{\"cast_id\": 5, \"character\": \"John Carter\", \"c... \n", "\n", " crew \n", "0 [{\"credit_id\": \"52fe48009251416c750aca23\", \"de... \n", "1 [{\"credit_id\": \"52fe4232c3a36847f800b579\", \"de... \n", "2 [{\"credit_id\": \"54805967c3a36829b5002c41\", \"de... \n", "3 [{\"credit_id\": \"52fe4781c3a36847f81398c3\", \"de... \n", "4 [{\"credit_id\": \"52fe479ac3a36847f813eaa3\", \"de... " ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movies = movies[['movie_id','title','overview','genres','keywords','cast','crew']]\n", "movies.head()" ] }, { "cell_type": "code", "execution_count": 9, "id": "1bf18225", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "movie_id 0\n", "title 0\n", "overview 3\n", "genres 0\n", "keywords 0\n", "cast 0\n", "crew 0\n", "dtype: int64" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movies.isnull().sum()" ] }, { "cell_type": "code", "execution_count": 10, "id": "e0253b07", "metadata": {}, "outputs": [], "source": [ "movies.dropna(inplace=True)\n" ] }, { "cell_type": "code", "execution_count": 11, "id": "5aa3722e", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(4806, 7)" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movies.shape" ] }, { "cell_type": "code", "execution_count": 12, "id": "c2b43baf", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movies.duplicated().sum()" ] }, { "cell_type": "code", "execution_count": 13, "id": "09e4500d", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'[{\"id\": 28, \"name\": \"Action\"}, {\"id\": 12, \"name\": \"Adventure\"}, {\"id\": 14, \"name\": \"Fantasy\"}, {\"id\": 878, \"name\": \"Science Fiction\"}]'" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movies.iloc[0].genres" ] }, { "cell_type": "code", "execution_count": 14, "id": "44fc2104", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[{'id': 28, 'name': 'Action'},\n", " {'id': 12, 'name': 'Adventure'},\n", " {'id': 14, 'name': 'Fantasy'},\n", " {'id': 878, 'name': 'Science Fiction'}]" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import ast\n", "ast.literal_eval('[{\"id\": 28, \"name\": \"Action\"}, {\"id\": 12, \"name\": \"Adventure\"}, {\"id\": 14, \"name\": \"Fantasy\"}, {\"id\": 878, \"name\": \"Science Fiction\"}]')" ] }, { "cell_type": "code", "execution_count": 15, "id": "f59e22f6", "metadata": {}, "outputs": [], "source": [ "def convert(obj):\n", " L = []\n", " for i in ast.literal_eval(obj):\n", " L.append(i['name'])\n", " return L " ] }, { "cell_type": "code", "execution_count": 16, "id": "ee741abf", "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", "
movie_idtitleoverviewgenreskeywordscastcrew
019995AvatarIn the 22nd century, a paraplegic Marine is di...[Action, Adventure, Fantasy, Science Fiction][{\"id\": 1463, \"name\": \"culture clash\"}, {\"id\":...[{\"cast_id\": 242, \"character\": \"Jake Sully\", \"...[{\"credit_id\": \"52fe48009251416c750aca23\", \"de...
1285Pirates of the Caribbean: At World's EndCaptain Barbossa, long believed to be dead, ha...[Adventure, Fantasy, Action][{\"id\": 270, \"name\": \"ocean\"}, {\"id\": 726, \"na...[{\"cast_id\": 4, \"character\": \"Captain Jack Spa...[{\"credit_id\": \"52fe4232c3a36847f800b579\", \"de...
2206647SpectreA cryptic message from Bond’s past sends him o...[Action, Adventure, Crime][{\"id\": 470, \"name\": \"spy\"}, {\"id\": 818, \"name...[{\"cast_id\": 1, \"character\": \"James Bond\", \"cr...[{\"credit_id\": \"54805967c3a36829b5002c41\", \"de...
349026The Dark Knight RisesFollowing the death of District Attorney Harve...[Action, Crime, Drama, Thriller][{\"id\": 849, \"name\": \"dc comics\"}, {\"id\": 853,...[{\"cast_id\": 2, \"character\": \"Bruce Wayne / Ba...[{\"credit_id\": \"52fe4781c3a36847f81398c3\", \"de...
449529John CarterJohn Carter is a war-weary, former military ca...[Action, Adventure, Science Fiction][{\"id\": 818, \"name\": \"based on novel\"}, {\"id\":...[{\"cast_id\": 5, \"character\": \"John Carter\", \"c...[{\"credit_id\": \"52fe479ac3a36847f813eaa3\", \"de...
\n", "
" ], "text/plain": [ " movie_id title \\\n", "0 19995 Avatar \n", "1 285 Pirates of the Caribbean: At World's End \n", "2 206647 Spectre \n", "3 49026 The Dark Knight Rises \n", "4 49529 John Carter \n", "\n", " overview \\\n", "0 In the 22nd century, a paraplegic Marine is di... \n", "1 Captain Barbossa, long believed to be dead, ha... \n", "2 A cryptic message from Bond’s past sends him o... \n", "3 Following the death of District Attorney Harve... \n", "4 John Carter is a war-weary, former military ca... \n", "\n", " genres \\\n", "0 [Action, Adventure, Fantasy, Science Fiction] \n", "1 [Adventure, Fantasy, Action] \n", "2 [Action, Adventure, Crime] \n", "3 [Action, Crime, Drama, Thriller] \n", "4 [Action, Adventure, Science Fiction] \n", "\n", " keywords \\\n", "0 [{\"id\": 1463, \"name\": \"culture clash\"}, {\"id\":... \n", "1 [{\"id\": 270, \"name\": \"ocean\"}, {\"id\": 726, \"na... \n", "2 [{\"id\": 470, \"name\": \"spy\"}, {\"id\": 818, \"name... \n", "3 [{\"id\": 849, \"name\": \"dc comics\"}, {\"id\": 853,... \n", "4 [{\"id\": 818, \"name\": \"based on novel\"}, {\"id\":... \n", "\n", " cast \\\n", "0 [{\"cast_id\": 242, \"character\": \"Jake Sully\", \"... \n", "1 [{\"cast_id\": 4, \"character\": \"Captain Jack Spa... \n", "2 [{\"cast_id\": 1, \"character\": \"James Bond\", \"cr... \n", "3 [{\"cast_id\": 2, \"character\": \"Bruce Wayne / Ba... \n", "4 [{\"cast_id\": 5, \"character\": \"John Carter\", \"c... \n", "\n", " crew \n", "0 [{\"credit_id\": \"52fe48009251416c750aca23\", \"de... \n", "1 [{\"credit_id\": \"52fe4232c3a36847f800b579\", \"de... \n", "2 [{\"credit_id\": \"54805967c3a36829b5002c41\", \"de... \n", "3 [{\"credit_id\": \"52fe4781c3a36847f81398c3\", \"de... \n", "4 [{\"credit_id\": \"52fe479ac3a36847f813eaa3\", \"de... " ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movies['genres'] = movies['genres'].apply(convert)\n", "movies.head()" ] }, { "cell_type": "code", "execution_count": 17, "id": "5808b1b8", "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", "
movie_idtitleoverviewgenreskeywordscastcrew
019995AvatarIn the 22nd century, a paraplegic Marine is di...[Action, Adventure, Fantasy, Science Fiction][culture clash, future, space war, space colon...[{\"cast_id\": 242, \"character\": \"Jake Sully\", \"...[{\"credit_id\": \"52fe48009251416c750aca23\", \"de...
1285Pirates of the Caribbean: At World's EndCaptain Barbossa, long believed to be dead, ha...[Adventure, Fantasy, Action][ocean, drug abuse, exotic island, east india ...[{\"cast_id\": 4, \"character\": \"Captain Jack Spa...[{\"credit_id\": \"52fe4232c3a36847f800b579\", \"de...
2206647SpectreA cryptic message from Bond’s past sends him o...[Action, Adventure, Crime][spy, based on novel, secret agent, sequel, mi...[{\"cast_id\": 1, \"character\": \"James Bond\", \"cr...[{\"credit_id\": \"54805967c3a36829b5002c41\", \"de...
349026The Dark Knight RisesFollowing the death of District Attorney Harve...[Action, Crime, Drama, Thriller][dc comics, crime fighter, terrorist, secret i...[{\"cast_id\": 2, \"character\": \"Bruce Wayne / Ba...[{\"credit_id\": \"52fe4781c3a36847f81398c3\", \"de...
449529John CarterJohn Carter is a war-weary, former military ca...[Action, Adventure, Science Fiction][based on novel, mars, medallion, space travel...[{\"cast_id\": 5, \"character\": \"John Carter\", \"c...[{\"credit_id\": \"52fe479ac3a36847f813eaa3\", \"de...
\n", "
" ], "text/plain": [ " movie_id title \\\n", "0 19995 Avatar \n", "1 285 Pirates of the Caribbean: At World's End \n", "2 206647 Spectre \n", "3 49026 The Dark Knight Rises \n", "4 49529 John Carter \n", "\n", " overview \\\n", "0 In the 22nd century, a paraplegic Marine is di... \n", "1 Captain Barbossa, long believed to be dead, ha... \n", "2 A cryptic message from Bond’s past sends him o... \n", "3 Following the death of District Attorney Harve... \n", "4 John Carter is a war-weary, former military ca... \n", "\n", " genres \\\n", "0 [Action, Adventure, Fantasy, Science Fiction] \n", "1 [Adventure, Fantasy, Action] \n", "2 [Action, Adventure, Crime] \n", "3 [Action, Crime, Drama, Thriller] \n", "4 [Action, Adventure, Science Fiction] \n", "\n", " keywords \\\n", "0 [culture clash, future, space war, space colon... \n", "1 [ocean, drug abuse, exotic island, east india ... \n", "2 [spy, based on novel, secret agent, sequel, mi... \n", "3 [dc comics, crime fighter, terrorist, secret i... \n", "4 [based on novel, mars, medallion, space travel... \n", "\n", " cast \\\n", "0 [{\"cast_id\": 242, \"character\": \"Jake Sully\", \"... \n", "1 [{\"cast_id\": 4, \"character\": \"Captain Jack Spa... \n", "2 [{\"cast_id\": 1, \"character\": \"James Bond\", \"cr... \n", "3 [{\"cast_id\": 2, \"character\": \"Bruce Wayne / Ba... \n", "4 [{\"cast_id\": 5, \"character\": \"John Carter\", \"c... \n", "\n", " crew \n", "0 [{\"credit_id\": \"52fe48009251416c750aca23\", \"de... \n", "1 [{\"credit_id\": \"52fe4232c3a36847f800b579\", \"de... \n", "2 [{\"credit_id\": \"54805967c3a36829b5002c41\", \"de... \n", "3 [{\"credit_id\": \"52fe4781c3a36847f81398c3\", \"de... \n", "4 [{\"credit_id\": \"52fe479ac3a36847f813eaa3\", \"de... " ] }, "execution_count": 17, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movies['keywords'] = movies['keywords'].apply(convert)\n", "movies.head()" ] }, { "cell_type": "code", "execution_count": 18, "id": "08a47f4b", "metadata": {}, "outputs": [], "source": [ "def convert3(obj):\n", " L = []\n", " counter=0\n", " for i in ast.literal_eval(obj):\n", " if counter != 3:\n", " L.append(i['name'])\n", " counter+=1\n", " else:\n", " break\n", " return L " ] }, { "cell_type": "code", "execution_count": 19, "id": "03851ae8", "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", "
movie_idtitleoverviewgenreskeywordscastcrew
019995AvatarIn the 22nd century, a paraplegic Marine is di...[Action, Adventure, Fantasy, Science Fiction][culture clash, future, space war, space colon...[Sam Worthington, Zoe Saldana, Sigourney Weaver][{\"credit_id\": \"52fe48009251416c750aca23\", \"de...
1285Pirates of the Caribbean: At World's EndCaptain Barbossa, long believed to be dead, ha...[Adventure, Fantasy, Action][ocean, drug abuse, exotic island, east india ...[Johnny Depp, Orlando Bloom, Keira Knightley][{\"credit_id\": \"52fe4232c3a36847f800b579\", \"de...
2206647SpectreA cryptic message from Bond’s past sends him o...[Action, Adventure, Crime][spy, based on novel, secret agent, sequel, mi...[Daniel Craig, Christoph Waltz, Léa Seydoux][{\"credit_id\": \"54805967c3a36829b5002c41\", \"de...
349026The Dark Knight RisesFollowing the death of District Attorney Harve...[Action, Crime, Drama, Thriller][dc comics, crime fighter, terrorist, secret i...[Christian Bale, Michael Caine, Gary Oldman][{\"credit_id\": \"52fe4781c3a36847f81398c3\", \"de...
449529John CarterJohn Carter is a war-weary, former military ca...[Action, Adventure, Science Fiction][based on novel, mars, medallion, space travel...[Taylor Kitsch, Lynn Collins, Samantha Morton][{\"credit_id\": \"52fe479ac3a36847f813eaa3\", \"de...
\n", "
" ], "text/plain": [ " movie_id title \\\n", "0 19995 Avatar \n", "1 285 Pirates of the Caribbean: At World's End \n", "2 206647 Spectre \n", "3 49026 The Dark Knight Rises \n", "4 49529 John Carter \n", "\n", " overview \\\n", "0 In the 22nd century, a paraplegic Marine is di... \n", "1 Captain Barbossa, long believed to be dead, ha... \n", "2 A cryptic message from Bond’s past sends him o... \n", "3 Following the death of District Attorney Harve... \n", "4 John Carter is a war-weary, former military ca... \n", "\n", " genres \\\n", "0 [Action, Adventure, Fantasy, Science Fiction] \n", "1 [Adventure, Fantasy, Action] \n", "2 [Action, Adventure, Crime] \n", "3 [Action, Crime, Drama, Thriller] \n", "4 [Action, Adventure, Science Fiction] \n", "\n", " keywords \\\n", "0 [culture clash, future, space war, space colon... \n", "1 [ocean, drug abuse, exotic island, east india ... \n", "2 [spy, based on novel, secret agent, sequel, mi... \n", "3 [dc comics, crime fighter, terrorist, secret i... \n", "4 [based on novel, mars, medallion, space travel... \n", "\n", " cast \\\n", "0 [Sam Worthington, Zoe Saldana, Sigourney Weaver] \n", "1 [Johnny Depp, Orlando Bloom, Keira Knightley] \n", "2 [Daniel Craig, Christoph Waltz, Léa Seydoux] \n", "3 [Christian Bale, Michael Caine, Gary Oldman] \n", "4 [Taylor Kitsch, Lynn Collins, Samantha Morton] \n", "\n", " crew \n", "0 [{\"credit_id\": \"52fe48009251416c750aca23\", \"de... \n", "1 [{\"credit_id\": \"52fe4232c3a36847f800b579\", \"de... \n", "2 [{\"credit_id\": \"54805967c3a36829b5002c41\", \"de... \n", "3 [{\"credit_id\": \"52fe4781c3a36847f81398c3\", \"de... \n", "4 [{\"credit_id\": \"52fe479ac3a36847f813eaa3\", \"de... " ] }, "execution_count": 19, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movies['cast'] = movies['cast'].apply(convert3)\n", "movies.head()" ] }, { "cell_type": "code", "execution_count": 20, "id": "a1ea75f0", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'[{\"credit_id\": \"52fe48009251416c750aca23\", \"department\": \"Editing\", \"gender\": 0, \"id\": 1721, \"job\": \"Editor\", \"name\": \"Stephen E. Rivkin\"}, {\"credit_id\": \"539c47ecc3a36810e3001f87\", \"department\": \"Art\", \"gender\": 2, \"id\": 496, \"job\": \"Production Design\", \"name\": \"Rick Carter\"}, {\"credit_id\": \"54491c89c3a3680fb4001cf7\", \"department\": \"Sound\", \"gender\": 0, \"id\": 900, \"job\": \"Sound Designer\", \"name\": \"Christopher Boyes\"}, {\"credit_id\": \"54491cb70e0a267480001bd0\", \"department\": \"Sound\", \"gender\": 0, \"id\": 900, \"job\": \"Supervising Sound Editor\", \"name\": \"Christopher Boyes\"}, {\"credit_id\": \"539c4a4cc3a36810c9002101\", \"department\": \"Production\", \"gender\": 1, \"id\": 1262, \"job\": \"Casting\", \"name\": \"Mali Finn\"}, {\"credit_id\": \"5544ee3b925141499f0008fc\", \"department\": \"Sound\", \"gender\": 2, \"id\": 1729, \"job\": \"Original Music Composer\", \"name\": \"James Horner\"}, {\"credit_id\": \"52fe48009251416c750ac9c3\", \"department\": \"Directing\", \"gender\": 2, \"id\": 2710, \"job\": \"Director\", \"name\": \"James Cameron\"}, {\"credit_id\": \"52fe48009251416c750ac9d9\", \"department\": \"Writing\", \"gender\": 2, \"id\": 2710, \"job\": \"Writer\", \"name\": \"James Cameron\"}, {\"credit_id\": \"52fe48009251416c750aca17\", \"department\": \"Editing\", \"gender\": 2, \"id\": 2710, \"job\": \"Editor\", \"name\": \"James Cameron\"}, {\"credit_id\": \"52fe48009251416c750aca29\", \"department\": \"Production\", \"gender\": 2, \"id\": 2710, \"job\": \"Producer\", \"name\": \"James Cameron\"}, {\"credit_id\": \"52fe48009251416c750aca3f\", \"department\": \"Writing\", \"gender\": 2, \"id\": 2710, \"job\": \"Screenplay\", \"name\": \"James Cameron\"}, {\"credit_id\": \"539c4987c3a36810ba0021a4\", \"department\": \"Art\", \"gender\": 2, \"id\": 7236, \"job\": \"Art Direction\", \"name\": \"Andrew Menzies\"}, {\"credit_id\": \"549598c3c3a3686ae9004383\", \"department\": \"Visual Effects\", \"gender\": 0, \"id\": 6690, \"job\": \"Visual Effects Producer\", \"name\": \"Jill Brooks\"}, {\"credit_id\": \"52fe48009251416c750aca4b\", \"department\": \"Production\", \"gender\": 1, \"id\": 6347, \"job\": \"Casting\", \"name\": \"Margery Simkin\"}, {\"credit_id\": \"570b6f419251417da70032fe\", \"department\": \"Art\", \"gender\": 2, \"id\": 6878, \"job\": \"Supervising Art Director\", \"name\": \"Kevin Ishioka\"}, {\"credit_id\": \"5495a0fac3a3686ae9004468\", \"department\": \"Sound\", \"gender\": 0, \"id\": 6883, \"job\": \"Music Editor\", \"name\": \"Dick Bernstein\"}, {\"credit_id\": \"54959706c3a3686af3003e81\", \"department\": \"Sound\", \"gender\": 0, \"id\": 8159, \"job\": \"Sound Effects Editor\", \"name\": \"Shannon Mills\"}, {\"credit_id\": \"54491d58c3a3680fb1001ccb\", \"department\": \"Sound\", \"gender\": 0, \"id\": 8160, \"job\": \"Foley\", \"name\": \"Dennie Thorpe\"}, {\"credit_id\": \"54491d6cc3a3680fa5001b2c\", \"department\": \"Sound\", \"gender\": 0, \"id\": 8163, \"job\": \"Foley\", \"name\": \"Jana Vance\"}, {\"credit_id\": \"52fe48009251416c750aca57\", \"department\": \"Costume & Make-Up\", \"gender\": 1, \"id\": 8527, \"job\": \"Costume Design\", \"name\": \"Deborah Lynn Scott\"}, {\"credit_id\": \"52fe48009251416c750aca2f\", \"department\": \"Production\", \"gender\": 2, \"id\": 8529, \"job\": \"Producer\", \"name\": \"Jon Landau\"}, {\"credit_id\": \"539c4937c3a36810ba002194\", \"department\": \"Art\", \"gender\": 0, \"id\": 9618, \"job\": \"Art Direction\", \"name\": \"Sean Haworth\"}, {\"credit_id\": \"539c49b6c3a36810c10020e6\", \"department\": \"Art\", \"gender\": 1, \"id\": 12653, \"job\": \"Set Decoration\", \"name\": \"Kim Sinclair\"}, {\"credit_id\": \"570b6f2f9251413a0e00020d\", \"department\": \"Art\", \"gender\": 1, \"id\": 12653, \"job\": \"Supervising Art Director\", \"name\": \"Kim Sinclair\"}, {\"credit_id\": \"54491a6c0e0a26748c001b19\", \"department\": \"Art\", \"gender\": 2, \"id\": 14350, \"job\": \"Set Designer\", \"name\": \"Richard F. Mays\"}, {\"credit_id\": \"56928cf4c3a3684cff0025c4\", \"department\": \"Production\", \"gender\": 1, \"id\": 20294, \"job\": \"Executive Producer\", \"name\": \"Laeta Kalogridis\"}, {\"credit_id\": \"52fe48009251416c750aca51\", \"department\": \"Costume & Make-Up\", \"gender\": 0, \"id\": 17675, \"job\": \"Costume Design\", \"name\": \"Mayes C. Rubeo\"}, {\"credit_id\": \"52fe48009251416c750aca11\", \"department\": \"Camera\", \"gender\": 2, \"id\": 18265, \"job\": \"Director of Photography\", \"name\": \"Mauro Fiore\"}, {\"credit_id\": \"5449194d0e0a26748f001b39\", \"department\": \"Art\", \"gender\": 0, \"id\": 42281, \"job\": \"Set Designer\", \"name\": \"Scott Herbertson\"}, {\"credit_id\": \"52fe48009251416c750aca05\", \"department\": \"Crew\", \"gender\": 0, \"id\": 42288, \"job\": \"Stunts\", \"name\": \"Woody Schultz\"}, {\"credit_id\": \"5592aefb92514152de0010f5\", \"department\": \"Costume & Make-Up\", \"gender\": 0, \"id\": 29067, \"job\": \"Makeup Artist\", \"name\": \"Linda DeVetta\"}, {\"credit_id\": \"5592afa492514152de00112c\", \"department\": \"Costume & Make-Up\", \"gender\": 0, \"id\": 29067, \"job\": \"Hairstylist\", \"name\": \"Linda DeVetta\"}, {\"credit_id\": \"54959ed592514130fc002e5d\", \"department\": \"Camera\", \"gender\": 2, \"id\": 33302, \"job\": \"Camera Operator\", \"name\": \"Richard Bluck\"}, {\"credit_id\": \"539c4891c3a36810ba002147\", \"department\": \"Art\", \"gender\": 2, \"id\": 33303, \"job\": \"Art Direction\", \"name\": \"Simon Bright\"}, {\"credit_id\": \"54959c069251417a81001f3a\", \"department\": \"Visual Effects\", \"gender\": 0, \"id\": 113145, \"job\": \"Visual Effects Supervisor\", \"name\": \"Richard Martin\"}, {\"credit_id\": \"54959a0dc3a3680ff5002c8d\", \"department\": \"Crew\", \"gender\": 2, \"id\": 58188, \"job\": \"Visual Effects Editor\", \"name\": \"Steve R. Moore\"}, {\"credit_id\": \"52fe48009251416c750aca1d\", \"department\": \"Editing\", \"gender\": 2, \"id\": 58871, \"job\": \"Editor\", \"name\": \"John Refoua\"}, {\"credit_id\": \"54491a4dc3a3680fc30018ca\", \"department\": \"Art\", \"gender\": 0, \"id\": 92359, \"job\": \"Set Designer\", \"name\": \"Karl J. Martin\"}, {\"credit_id\": \"52fe48009251416c750aca35\", \"department\": \"Camera\", \"gender\": 1, \"id\": 72201, \"job\": \"Director of Photography\", \"name\": \"Chiling Lin\"}, {\"credit_id\": \"52fe48009251416c750ac9ff\", \"department\": \"Crew\", \"gender\": 0, \"id\": 89714, \"job\": \"Stunts\", \"name\": \"Ilram Choi\"}, {\"credit_id\": \"54959c529251416e2b004394\", \"department\": \"Visual Effects\", \"gender\": 2, \"id\": 93214, \"job\": \"Visual Effects Supervisor\", \"name\": \"Steven Quale\"}, {\"credit_id\": \"54491edf0e0a267489001c37\", \"department\": \"Crew\", \"gender\": 1, \"id\": 122607, \"job\": \"Dialect Coach\", \"name\": \"Carla Meyer\"}, {\"credit_id\": \"539c485bc3a368653d001a3a\", \"department\": \"Art\", \"gender\": 2, \"id\": 132585, \"job\": \"Art Direction\", \"name\": \"Nick Bassett\"}, {\"credit_id\": \"539c4903c3a368653d001a74\", \"department\": \"Art\", \"gender\": 0, \"id\": 132596, \"job\": \"Art Direction\", \"name\": \"Jill Cormack\"}, {\"credit_id\": \"539c4967c3a368653d001a94\", \"department\": \"Art\", \"gender\": 0, \"id\": 132604, \"job\": \"Art Direction\", \"name\": \"Andy McLaren\"}, {\"credit_id\": \"52fe48009251416c750aca45\", \"department\": \"Crew\", \"gender\": 0, \"id\": 236696, \"job\": \"Motion Capture Artist\", \"name\": \"Terry Notary\"}, {\"credit_id\": \"54959e02c3a3680fc60027d2\", \"department\": \"Crew\", \"gender\": 2, \"id\": 956198, \"job\": \"Stunt Coordinator\", \"name\": \"Garrett Warren\"}, {\"credit_id\": \"54959ca3c3a3686ae300438c\", \"department\": \"Visual Effects\", \"gender\": 2, \"id\": 957874, \"job\": \"Visual Effects Supervisor\", \"name\": \"Jonathan Rothbart\"}, {\"credit_id\": \"570b6f519251412c74001b2f\", \"department\": \"Art\", \"gender\": 0, \"id\": 957889, \"job\": \"Supervising Art Director\", \"name\": \"Stefan Dechant\"}, {\"credit_id\": \"570b6f62c3a3680b77007460\", \"department\": \"Art\", \"gender\": 2, \"id\": 959555, \"job\": \"Supervising Art Director\", \"name\": \"Todd Cherniawsky\"}, {\"credit_id\": \"539c4a3ac3a36810da0021cc\", \"department\": \"Production\", \"gender\": 0, \"id\": 1016177, \"job\": \"Casting\", \"name\": \"Miranda Rivers\"}, {\"credit_id\": \"539c482cc3a36810c1002062\", \"department\": \"Art\", \"gender\": 0, \"id\": 1032536, \"job\": \"Production Design\", \"name\": \"Robert Stromberg\"}, {\"credit_id\": \"539c4b65c3a36810c9002125\", \"department\": \"Costume & Make-Up\", \"gender\": 2, \"id\": 1071680, \"job\": \"Costume Design\", \"name\": \"John Harding\"}, {\"credit_id\": \"54959e6692514130fc002e4e\", \"department\": \"Camera\", \"gender\": 0, \"id\": 1177364, \"job\": \"Steadicam Operator\", \"name\": \"Roberto De Angelis\"}, {\"credit_id\": \"539c49f1c3a368653d001aac\", \"department\": \"Costume & Make-Up\", \"gender\": 2, \"id\": 1202850, \"job\": \"Makeup Department Head\", \"name\": \"Mike Smithson\"}, {\"credit_id\": \"5495999ec3a3686ae100460c\", \"department\": \"Visual Effects\", \"gender\": 0, \"id\": 1204668, \"job\": \"Visual Effects Producer\", \"name\": \"Alain Lalanne\"}, {\"credit_id\": \"54959cdfc3a3681153002729\", \"department\": \"Visual Effects\", \"gender\": 0, \"id\": 1206410, \"job\": \"Visual Effects Supervisor\", \"name\": \"Lucas Salton\"}, {\"credit_id\": \"549596239251417a81001eae\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1234266, \"job\": \"Post Production Supervisor\", \"name\": \"Janace Tashjian\"}, {\"credit_id\": \"54959c859251416e1e003efe\", \"department\": \"Visual Effects\", \"gender\": 0, \"id\": 1271932, \"job\": \"Visual Effects Supervisor\", \"name\": \"Stephen Rosenbaum\"}, {\"credit_id\": \"5592af28c3a368775a00105f\", \"department\": \"Costume & Make-Up\", \"gender\": 0, \"id\": 1310064, \"job\": \"Makeup Artist\", \"name\": \"Frankie Karena\"}, {\"credit_id\": \"539c4adfc3a36810e300203b\", \"department\": \"Costume & Make-Up\", \"gender\": 1, \"id\": 1319844, \"job\": \"Costume Supervisor\", \"name\": \"Lisa Lovaas\"}, {\"credit_id\": \"54959b579251416e2b004371\", \"department\": \"Visual Effects\", \"gender\": 0, \"id\": 1327028, \"job\": \"Visual Effects Supervisor\", \"name\": \"Jonathan Fawkner\"}, {\"credit_id\": \"539c48a7c3a36810b5001fa7\", \"department\": \"Art\", \"gender\": 0, \"id\": 1330561, \"job\": \"Art Direction\", \"name\": \"Robert Bavin\"}, {\"credit_id\": \"539c4a71c3a36810da0021e0\", \"department\": \"Costume & Make-Up\", \"gender\": 0, \"id\": 1330567, \"job\": \"Costume Supervisor\", \"name\": \"Anthony Almaraz\"}, {\"credit_id\": \"539c4a8ac3a36810ba0021e4\", \"department\": \"Costume & Make-Up\", \"gender\": 0, \"id\": 1330570, \"job\": \"Costume Supervisor\", \"name\": \"Carolyn M. Fenton\"}, {\"credit_id\": \"539c4ab6c3a36810da0021f0\", \"department\": \"Costume & Make-Up\", \"gender\": 0, \"id\": 1330574, \"job\": \"Costume Supervisor\", \"name\": \"Beth Koenigsberg\"}, {\"credit_id\": \"54491ab70e0a267480001ba2\", \"department\": \"Art\", \"gender\": 0, \"id\": 1336191, \"job\": \"Set Designer\", \"name\": \"Sam Page\"}, {\"credit_id\": \"544919d9c3a3680fc30018bd\", \"department\": \"Art\", \"gender\": 0, \"id\": 1339441, \"job\": \"Set Designer\", \"name\": \"Tex Kadonaga\"}, {\"credit_id\": \"54491cf50e0a267483001b0c\", \"department\": \"Editing\", \"gender\": 0, \"id\": 1352422, \"job\": \"Dialogue Editor\", \"name\": \"Kim Foscato\"}, {\"credit_id\": \"544919f40e0a26748c001b09\", \"department\": \"Art\", \"gender\": 0, \"id\": 1352962, \"job\": \"Set Designer\", \"name\": \"Tammy S. Lee\"}, {\"credit_id\": \"5495a115c3a3680ff5002d71\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1357070, \"job\": \"Transportation Coordinator\", \"name\": \"Denny Caira\"}, {\"credit_id\": \"5495a12f92514130fc002e94\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1357071, \"job\": \"Transportation Coordinator\", \"name\": \"James Waitkus\"}, {\"credit_id\": \"5495976fc3a36811530026b0\", \"department\": \"Sound\", \"gender\": 0, \"id\": 1360103, \"job\": \"Supervising Sound Editor\", \"name\": \"Addison Teague\"}, {\"credit_id\": \"54491837c3a3680fb1001c5a\", \"department\": \"Art\", \"gender\": 2, \"id\": 1376887, \"job\": \"Set Designer\", \"name\": \"C. Scott Baker\"}, {\"credit_id\": \"54491878c3a3680fb4001c9d\", \"department\": \"Art\", \"gender\": 0, \"id\": 1376888, \"job\": \"Set Designer\", \"name\": \"Luke Caska\"}, {\"credit_id\": \"544918dac3a3680fa5001ae0\", \"department\": \"Art\", \"gender\": 0, \"id\": 1376889, \"job\": \"Set Designer\", \"name\": \"David Chow\"}, {\"credit_id\": \"544919110e0a267486001b68\", \"department\": \"Art\", \"gender\": 0, \"id\": 1376890, \"job\": \"Set Designer\", \"name\": \"Jonathan Dyer\"}, {\"credit_id\": \"54491967c3a3680faa001b5e\", \"department\": \"Art\", \"gender\": 0, \"id\": 1376891, \"job\": \"Set Designer\", \"name\": \"Joseph Hiura\"}, {\"credit_id\": \"54491997c3a3680fb1001c8a\", \"department\": \"Art\", \"gender\": 0, \"id\": 1376892, \"job\": \"Art Department Coordinator\", \"name\": \"Rebecca Jellie\"}, {\"credit_id\": \"544919ba0e0a26748f001b42\", \"department\": \"Art\", \"gender\": 0, \"id\": 1376893, \"job\": \"Set Designer\", \"name\": \"Robert Andrew Johnson\"}, {\"credit_id\": \"54491b1dc3a3680faa001b8c\", \"department\": \"Art\", \"gender\": 0, \"id\": 1376895, \"job\": \"Assistant Art Director\", \"name\": \"Mike Stassi\"}, {\"credit_id\": \"54491b79c3a3680fbb001826\", \"department\": \"Art\", \"gender\": 0, \"id\": 1376897, \"job\": \"Construction Coordinator\", \"name\": \"John Villarino\"}, {\"credit_id\": \"54491baec3a3680fb4001ce6\", \"department\": \"Art\", \"gender\": 2, \"id\": 1376898, \"job\": \"Assistant Art Director\", \"name\": \"Jeffrey Wisniewski\"}, {\"credit_id\": \"54491d2fc3a3680fb4001d07\", \"department\": \"Editing\", \"gender\": 0, \"id\": 1376899, \"job\": \"Dialogue Editor\", \"name\": \"Cheryl Nardi\"}, {\"credit_id\": \"54491d86c3a3680fa5001b2f\", \"department\": \"Editing\", \"gender\": 0, \"id\": 1376901, \"job\": \"Dialogue Editor\", \"name\": \"Marshall Winn\"}, {\"credit_id\": \"54491d9dc3a3680faa001bb0\", \"department\": \"Sound\", \"gender\": 0, \"id\": 1376902, \"job\": \"Supervising Sound Editor\", \"name\": \"Gwendolyn Yates Whittle\"}, {\"credit_id\": \"54491dc10e0a267486001bce\", \"department\": \"Sound\", \"gender\": 0, \"id\": 1376903, \"job\": \"Sound Re-Recording Mixer\", \"name\": \"William Stein\"}, {\"credit_id\": \"54491f500e0a26747c001c07\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1376909, \"job\": \"Choreographer\", \"name\": \"Lula Washington\"}, {\"credit_id\": \"549599239251412c4e002a2e\", \"department\": \"Visual Effects\", \"gender\": 0, \"id\": 1391692, \"job\": \"Visual Effects Producer\", \"name\": \"Chris Del Conte\"}, {\"credit_id\": \"54959d54c3a36831b8001d9a\", \"department\": \"Visual Effects\", \"gender\": 2, \"id\": 1391695, \"job\": \"Visual Effects Supervisor\", \"name\": \"R. Christopher White\"}, {\"credit_id\": \"54959bdf9251412c4e002a66\", \"department\": \"Visual Effects\", \"gender\": 0, \"id\": 1394070, \"job\": \"Visual Effects Supervisor\", \"name\": \"Dan Lemmon\"}, {\"credit_id\": \"5495971d92514132ed002922\", \"department\": \"Sound\", \"gender\": 0, \"id\": 1394129, \"job\": \"Sound Effects Editor\", \"name\": \"Tim Nielsen\"}, {\"credit_id\": \"5592b25792514152cc0011aa\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1394286, \"job\": \"CG Supervisor\", \"name\": \"Michael Mulholland\"}, {\"credit_id\": \"54959a329251416e2b004355\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1394750, \"job\": \"Visual Effects Editor\", \"name\": \"Thomas Nittmann\"}, {\"credit_id\": \"54959d6dc3a3686ae9004401\", \"department\": \"Visual Effects\", \"gender\": 0, \"id\": 1394755, \"job\": \"Visual Effects Supervisor\", \"name\": \"Edson Williams\"}, {\"credit_id\": \"5495a08fc3a3686ae300441c\", \"department\": \"Editing\", \"gender\": 0, \"id\": 1394953, \"job\": \"Digital Intermediate\", \"name\": \"Christine Carr\"}, {\"credit_id\": \"55402d659251413d6d000249\", \"department\": \"Visual Effects\", \"gender\": 0, \"id\": 1395269, \"job\": \"Visual Effects Supervisor\", \"name\": \"John Bruno\"}, {\"credit_id\": \"54959e7b9251416e1e003f3e\", \"department\": \"Camera\", \"gender\": 0, \"id\": 1398970, \"job\": \"Steadicam Operator\", \"name\": \"David Emmerichs\"}, {\"credit_id\": \"54959734c3a3686ae10045e0\", \"department\": \"Sound\", \"gender\": 0, \"id\": 1400906, \"job\": \"Sound Effects Editor\", \"name\": \"Christopher Scarabosio\"}, {\"credit_id\": \"549595dd92514130fc002d79\", \"department\": \"Production\", \"gender\": 0, \"id\": 1401784, \"job\": \"Production Supervisor\", \"name\": \"Jennifer Teves\"}, {\"credit_id\": \"549596009251413af70028cc\", \"department\": \"Production\", \"gender\": 0, \"id\": 1401785, \"job\": \"Production Manager\", \"name\": \"Brigitte Yorke\"}, {\"credit_id\": \"549596e892514130fc002d99\", \"department\": \"Sound\", \"gender\": 0, \"id\": 1401786, \"job\": \"Sound Effects Editor\", \"name\": \"Ken Fischer\"}, {\"credit_id\": \"549598229251412c4e002a1c\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1401787, \"job\": \"Special Effects Coordinator\", \"name\": \"Iain Hutton\"}, {\"credit_id\": \"549598349251416e2b00432b\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1401788, \"job\": \"Special Effects Coordinator\", \"name\": \"Steve Ingram\"}, {\"credit_id\": \"54959905c3a3686ae3004324\", \"department\": \"Visual Effects\", \"gender\": 0, \"id\": 1401789, \"job\": \"Visual Effects Producer\", \"name\": \"Joyce Cox\"}, {\"credit_id\": \"5495994b92514132ed002951\", \"department\": \"Visual Effects\", \"gender\": 0, \"id\": 1401790, \"job\": \"Visual Effects Producer\", \"name\": \"Jenny Foster\"}, {\"credit_id\": \"549599cbc3a3686ae1004613\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1401791, \"job\": \"Visual Effects Editor\", \"name\": \"Christopher Marino\"}, {\"credit_id\": \"549599f2c3a3686ae100461e\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1401792, \"job\": \"Visual Effects Editor\", \"name\": \"Jim Milton\"}, {\"credit_id\": \"54959a51c3a3686af3003eb5\", \"department\": \"Visual Effects\", \"gender\": 0, \"id\": 1401793, \"job\": \"Visual Effects Producer\", \"name\": \"Cyndi Ochs\"}, {\"credit_id\": \"54959a7cc3a36811530026f4\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1401794, \"job\": \"Visual Effects Editor\", \"name\": \"Lucas Putnam\"}, {\"credit_id\": \"54959b91c3a3680ff5002cb4\", \"department\": \"Visual Effects\", \"gender\": 0, \"id\": 1401795, \"job\": \"Visual Effects Supervisor\", \"name\": \"Anthony \\'Max\\' Ivins\"}, {\"credit_id\": \"54959bb69251412c4e002a5f\", \"department\": \"Visual Effects\", \"gender\": 0, \"id\": 1401796, \"job\": \"Visual Effects Supervisor\", \"name\": \"John Knoll\"}, {\"credit_id\": \"54959cbbc3a3686ae3004391\", \"department\": \"Visual Effects\", \"gender\": 2, \"id\": 1401799, \"job\": \"Visual Effects Supervisor\", \"name\": \"Eric Saindon\"}, {\"credit_id\": \"54959d06c3a3686ae90043f6\", \"department\": \"Visual Effects\", \"gender\": 0, \"id\": 1401800, \"job\": \"Visual Effects Supervisor\", \"name\": \"Wayne Stables\"}, {\"credit_id\": \"54959d259251416e1e003f11\", \"department\": \"Visual Effects\", \"gender\": 0, \"id\": 1401801, \"job\": \"Visual Effects Supervisor\", \"name\": \"David Stinnett\"}, {\"credit_id\": \"54959db49251413af7002975\", \"department\": \"Visual Effects\", \"gender\": 0, \"id\": 1401803, \"job\": \"Visual Effects Supervisor\", \"name\": \"Guy Williams\"}, {\"credit_id\": \"54959de4c3a3681153002750\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1401804, \"job\": \"Stunt Coordinator\", \"name\": \"Stuart Thorp\"}, {\"credit_id\": \"54959ef2c3a3680fc60027f2\", \"department\": \"Lighting\", \"gender\": 0, \"id\": 1401805, \"job\": \"Best Boy Electric\", \"name\": \"Giles Coburn\"}, {\"credit_id\": \"54959f07c3a3680fc60027f9\", \"department\": \"Camera\", \"gender\": 2, \"id\": 1401806, \"job\": \"Still Photographer\", \"name\": \"Mark Fellman\"}, {\"credit_id\": \"54959f47c3a3681153002774\", \"department\": \"Lighting\", \"gender\": 0, \"id\": 1401807, \"job\": \"Lighting Technician\", \"name\": \"Scott Sprague\"}, {\"credit_id\": \"54959f8cc3a36831b8001df2\", \"department\": \"Visual Effects\", \"gender\": 0, \"id\": 1401808, \"job\": \"Animation Director\", \"name\": \"Jeremy Hollobon\"}, {\"credit_id\": \"54959fa0c3a36831b8001dfb\", \"department\": \"Visual Effects\", \"gender\": 0, \"id\": 1401809, \"job\": \"Animation Director\", \"name\": \"Orlando Meunier\"}, {\"credit_id\": \"54959fb6c3a3686af3003f54\", \"department\": \"Visual Effects\", \"gender\": 0, \"id\": 1401810, \"job\": \"Animation Director\", \"name\": \"Taisuke Tanimura\"}, {\"credit_id\": \"54959fd2c3a36831b8001e02\", \"department\": \"Costume & Make-Up\", \"gender\": 0, \"id\": 1401812, \"job\": \"Set Costumer\", \"name\": \"Lilia Mishel Acevedo\"}, {\"credit_id\": \"54959ff9c3a3686ae300440c\", \"department\": \"Costume & Make-Up\", \"gender\": 0, \"id\": 1401814, \"job\": \"Set Costumer\", \"name\": \"Alejandro M. Hernandez\"}, {\"credit_id\": \"5495a0ddc3a3686ae10046fe\", \"department\": \"Editing\", \"gender\": 0, \"id\": 1401815, \"job\": \"Digital Intermediate\", \"name\": \"Marvin Hall\"}, {\"credit_id\": \"5495a1f7c3a3686ae3004443\", \"department\": \"Production\", \"gender\": 0, \"id\": 1401816, \"job\": \"Publicist\", \"name\": \"Judy Alley\"}, {\"credit_id\": \"5592b29fc3a36869d100002f\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1418381, \"job\": \"CG Supervisor\", \"name\": \"Mike Perry\"}, {\"credit_id\": \"5592b23a9251415df8001081\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1426854, \"job\": \"CG Supervisor\", \"name\": \"Andrew Morley\"}, {\"credit_id\": \"55491e1192514104c40002d8\", \"department\": \"Art\", \"gender\": 0, \"id\": 1438901, \"job\": \"Conceptual Design\", \"name\": \"Seth Engstrom\"}, {\"credit_id\": \"5525d5809251417276002b06\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1447362, \"job\": \"Visual Effects Art Director\", \"name\": \"Eric Oliver\"}, {\"credit_id\": \"554427ca925141586500312a\", \"department\": \"Visual Effects\", \"gender\": 0, \"id\": 1447503, \"job\": \"Modeling\", \"name\": \"Matsune Suzuki\"}, {\"credit_id\": \"551906889251415aab001c88\", \"department\": \"Art\", \"gender\": 0, \"id\": 1447524, \"job\": \"Art Department Manager\", \"name\": \"Paul Tobin\"}, {\"credit_id\": \"5592af8492514152cc0010de\", \"department\": \"Costume & Make-Up\", \"gender\": 0, \"id\": 1452643, \"job\": \"Hairstylist\", \"name\": \"Roxane Griffin\"}, {\"credit_id\": \"553d3c109251415852001318\", \"department\": \"Lighting\", \"gender\": 0, \"id\": 1453938, \"job\": \"Lighting Artist\", \"name\": \"Arun Ram-Mohan\"}, {\"credit_id\": \"5592af4692514152d5001355\", \"department\": \"Costume & Make-Up\", \"gender\": 0, \"id\": 1457305, \"job\": \"Makeup Artist\", \"name\": \"Georgia Lockhart-Adams\"}, {\"credit_id\": \"5592b2eac3a36877470012a5\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1466035, \"job\": \"CG Supervisor\", \"name\": \"Thrain Shadbolt\"}, {\"credit_id\": \"5592b032c3a36877450015f1\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1483220, \"job\": \"CG Supervisor\", \"name\": \"Brad Alexander\"}, {\"credit_id\": \"5592b05592514152d80012f6\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1483221, \"job\": \"CG Supervisor\", \"name\": \"Shadi Almassizadeh\"}, {\"credit_id\": \"5592b090c3a36877570010b5\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1483222, \"job\": \"CG Supervisor\", \"name\": \"Simon Clutterbuck\"}, {\"credit_id\": \"5592b0dbc3a368774b00112c\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1483223, \"job\": \"CG Supervisor\", \"name\": \"Graeme Demmocks\"}, {\"credit_id\": \"5592b0fe92514152db0010c1\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1483224, \"job\": \"CG Supervisor\", \"name\": \"Adrian Fernandes\"}, {\"credit_id\": \"5592b11f9251415df8001059\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1483225, \"job\": \"CG Supervisor\", \"name\": \"Mitch Gates\"}, {\"credit_id\": \"5592b15dc3a3687745001645\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1483226, \"job\": \"CG Supervisor\", \"name\": \"Jerry Kung\"}, {\"credit_id\": \"5592b18e925141645a0004ae\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1483227, \"job\": \"CG Supervisor\", \"name\": \"Andy Lomas\"}, {\"credit_id\": \"5592b1bfc3a368775d0010e7\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1483228, \"job\": \"CG Supervisor\", \"name\": \"Sebastian Marino\"}, {\"credit_id\": \"5592b2049251415df8001078\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1483229, \"job\": \"CG Supervisor\", \"name\": \"Matthias Menz\"}, {\"credit_id\": \"5592b27b92514152d800136a\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1483230, \"job\": \"CG Supervisor\", \"name\": \"Sergei Nevshupov\"}, {\"credit_id\": \"5592b2c3c3a36869e800003c\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1483231, \"job\": \"CG Supervisor\", \"name\": \"Philippe Rebours\"}, {\"credit_id\": \"5592b317c3a36877470012af\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1483232, \"job\": \"CG Supervisor\", \"name\": \"Michael Takarangi\"}, {\"credit_id\": \"5592b345c3a36877470012bb\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1483233, \"job\": \"CG Supervisor\", \"name\": \"David Weitzberg\"}, {\"credit_id\": \"5592b37cc3a368775100113b\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1483234, \"job\": \"CG Supervisor\", \"name\": \"Ben White\"}, {\"credit_id\": \"573c8e2f9251413f5d000094\", \"department\": \"Crew\", \"gender\": 1, \"id\": 1621932, \"job\": \"Stunts\", \"name\": \"Min Windle\"}]'" ] }, "execution_count": 20, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movies['crew'][0]" ] }, { "cell_type": "code", "execution_count": 21, "id": "38afb494", "metadata": {}, "outputs": [], "source": [ "def fetch_director(obj):\n", " L = []\n", " for i in ast.literal_eval(obj):\n", " if i['job'] == 'Director':\n", " L.append(i['name'])\n", " break\n", " return L " ] }, { "cell_type": "code", "execution_count": 22, "id": "e65ca214", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0 [James Cameron]\n", "1 [Gore Verbinski]\n", "2 [Sam Mendes]\n", "3 [Christopher Nolan]\n", "4 [Andrew Stanton]\n", " ... \n", "4804 [Robert Rodriguez]\n", "4805 [Edward Burns]\n", "4806 [Scott Smith]\n", "4807 [Daniel Hsia]\n", "4808 [Brian Herzlinger]\n", "Name: crew, Length: 4806, dtype: object" ] }, "execution_count": 22, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movies['crew'].apply(fetch_director)\n" ] }, { "cell_type": "code", "execution_count": 23, "id": "97735759", "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", "
movie_idtitleoverviewgenreskeywordscastcrew
019995AvatarIn the 22nd century, a paraplegic Marine is di...[Action, Adventure, Fantasy, Science Fiction][culture clash, future, space war, space colon...[Sam Worthington, Zoe Saldana, Sigourney Weaver][James Cameron]
1285Pirates of the Caribbean: At World's EndCaptain Barbossa, long believed to be dead, ha...[Adventure, Fantasy, Action][ocean, drug abuse, exotic island, east india ...[Johnny Depp, Orlando Bloom, Keira Knightley][Gore Verbinski]
2206647SpectreA cryptic message from Bond’s past sends him o...[Action, Adventure, Crime][spy, based on novel, secret agent, sequel, mi...[Daniel Craig, Christoph Waltz, Léa Seydoux][Sam Mendes]
349026The Dark Knight RisesFollowing the death of District Attorney Harve...[Action, Crime, Drama, Thriller][dc comics, crime fighter, terrorist, secret i...[Christian Bale, Michael Caine, Gary Oldman][Christopher Nolan]
449529John CarterJohn Carter is a war-weary, former military ca...[Action, Adventure, Science Fiction][based on novel, mars, medallion, space travel...[Taylor Kitsch, Lynn Collins, Samantha Morton][Andrew Stanton]
\n", "
" ], "text/plain": [ " movie_id title \\\n", "0 19995 Avatar \n", "1 285 Pirates of the Caribbean: At World's End \n", "2 206647 Spectre \n", "3 49026 The Dark Knight Rises \n", "4 49529 John Carter \n", "\n", " overview \\\n", "0 In the 22nd century, a paraplegic Marine is di... \n", "1 Captain Barbossa, long believed to be dead, ha... \n", "2 A cryptic message from Bond’s past sends him o... \n", "3 Following the death of District Attorney Harve... \n", "4 John Carter is a war-weary, former military ca... \n", "\n", " genres \\\n", "0 [Action, Adventure, Fantasy, Science Fiction] \n", "1 [Adventure, Fantasy, Action] \n", "2 [Action, Adventure, Crime] \n", "3 [Action, Crime, Drama, Thriller] \n", "4 [Action, Adventure, Science Fiction] \n", "\n", " keywords \\\n", "0 [culture clash, future, space war, space colon... \n", "1 [ocean, drug abuse, exotic island, east india ... \n", "2 [spy, based on novel, secret agent, sequel, mi... \n", "3 [dc comics, crime fighter, terrorist, secret i... \n", "4 [based on novel, mars, medallion, space travel... \n", "\n", " cast crew \n", "0 [Sam Worthington, Zoe Saldana, Sigourney Weaver] [James Cameron] \n", "1 [Johnny Depp, Orlando Bloom, Keira Knightley] [Gore Verbinski] \n", "2 [Daniel Craig, Christoph Waltz, Léa Seydoux] [Sam Mendes] \n", "3 [Christian Bale, Michael Caine, Gary Oldman] [Christopher Nolan] \n", "4 [Taylor Kitsch, Lynn Collins, Samantha Morton] [Andrew Stanton] " ] }, "execution_count": 23, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movies['crew'] = movies['crew'].apply(fetch_director)\n", "movies.head()" ] }, { "cell_type": "code", "execution_count": 24, "id": "560c2c4e", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'In the 22nd century, a paraplegic Marine is dispatched to the moon Pandora on a unique mission, but becomes torn between following orders and protecting an alien civilization.'" ] }, "execution_count": 24, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movies['overview'][0]" ] }, { "cell_type": "code", "execution_count": 25, "id": "5da97181", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0 [In, the, 22nd, century,, a, paraplegic, Marin...\n", "1 [Captain, Barbossa,, long, believed, to, be, d...\n", "2 [A, cryptic, message, from, Bond’s, past, send...\n", "3 [Following, the, death, of, District, Attorney...\n", "4 [John, Carter, is, a, war-weary,, former, mili...\n", " ... \n", "4804 [El, Mariachi, just, wants, to, play, his, gui...\n", "4805 [A, newlywed, couple's, honeymoon, is, upended...\n", "4806 [\"Signed,, Sealed,, Delivered\", introduces, a,...\n", "4807 [When, ambitious, New, York, attorney, Sam, is...\n", "4808 [Ever, since, the, second, grade, when, he, fi...\n", "Name: overview, Length: 4806, dtype: object" ] }, "execution_count": 25, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movies['overview'].apply(lambda x: x.split())" ] }, { "cell_type": "code", "execution_count": 26, "id": "26646f1c", "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", "
movie_idtitleoverviewgenreskeywordscastcrew
019995Avatar[In, the, 22nd, century,, a, paraplegic, Marin...[Action, Adventure, Fantasy, Science Fiction][culture clash, future, space war, space colon...[Sam Worthington, Zoe Saldana, Sigourney Weaver][James Cameron]
1285Pirates of the Caribbean: At World's End[Captain, Barbossa,, long, believed, to, be, d...[Adventure, Fantasy, Action][ocean, drug abuse, exotic island, east india ...[Johnny Depp, Orlando Bloom, Keira Knightley][Gore Verbinski]
2206647Spectre[A, cryptic, message, from, Bond’s, past, send...[Action, Adventure, Crime][spy, based on novel, secret agent, sequel, mi...[Daniel Craig, Christoph Waltz, Léa Seydoux][Sam Mendes]
349026The Dark Knight Rises[Following, the, death, of, District, Attorney...[Action, Crime, Drama, Thriller][dc comics, crime fighter, terrorist, secret i...[Christian Bale, Michael Caine, Gary Oldman][Christopher Nolan]
449529John Carter[John, Carter, is, a, war-weary,, former, mili...[Action, Adventure, Science Fiction][based on novel, mars, medallion, space travel...[Taylor Kitsch, Lynn Collins, Samantha Morton][Andrew Stanton]
\n", "
" ], "text/plain": [ " movie_id title \\\n", "0 19995 Avatar \n", "1 285 Pirates of the Caribbean: At World's End \n", "2 206647 Spectre \n", "3 49026 The Dark Knight Rises \n", "4 49529 John Carter \n", "\n", " overview \\\n", "0 [In, the, 22nd, century,, a, paraplegic, Marin... \n", "1 [Captain, Barbossa,, long, believed, to, be, d... \n", "2 [A, cryptic, message, from, Bond’s, past, send... \n", "3 [Following, the, death, of, District, Attorney... \n", "4 [John, Carter, is, a, war-weary,, former, mili... \n", "\n", " genres \\\n", "0 [Action, Adventure, Fantasy, Science Fiction] \n", "1 [Adventure, Fantasy, Action] \n", "2 [Action, Adventure, Crime] \n", "3 [Action, Crime, Drama, Thriller] \n", "4 [Action, Adventure, Science Fiction] \n", "\n", " keywords \\\n", "0 [culture clash, future, space war, space colon... \n", "1 [ocean, drug abuse, exotic island, east india ... \n", "2 [spy, based on novel, secret agent, sequel, mi... \n", "3 [dc comics, crime fighter, terrorist, secret i... \n", "4 [based on novel, mars, medallion, space travel... \n", "\n", " cast crew \n", "0 [Sam Worthington, Zoe Saldana, Sigourney Weaver] [James Cameron] \n", "1 [Johnny Depp, Orlando Bloom, Keira Knightley] [Gore Verbinski] \n", "2 [Daniel Craig, Christoph Waltz, Léa Seydoux] [Sam Mendes] \n", "3 [Christian Bale, Michael Caine, Gary Oldman] [Christopher Nolan] \n", "4 [Taylor Kitsch, Lynn Collins, Samantha Morton] [Andrew Stanton] " ] }, "execution_count": 26, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movies['overview'] = movies['overview'].apply(lambda x: x.split())\n", "movies.head()" ] }, { "cell_type": "code", "execution_count": 27, "id": "160a4c81", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0 [Action, Adventure, Fantasy, ScienceFiction]\n", "1 [Adventure, Fantasy, Action]\n", "2 [Action, Adventure, Crime]\n", "3 [Action, Crime, Drama, Thriller]\n", "4 [Action, Adventure, ScienceFiction]\n", " ... \n", "4804 [Action, Crime, Thriller]\n", "4805 [Comedy, Romance]\n", "4806 [Comedy, Drama, Romance, TVMovie]\n", "4807 []\n", "4808 [Documentary]\n", "Name: genres, Length: 4806, dtype: object" ] }, "execution_count": 27, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movies['genres'].apply(lambda x: [i.replace(\" \",\"\") for i in x])" ] }, { "cell_type": "code", "execution_count": 28, "id": "a2965582", "metadata": {}, "outputs": [], "source": [ "movies['genres'] = movies['genres'].apply(lambda x: [i.replace(\" \",\"\") for i in x])\n", "movies['keywords'] = movies['keywords'].apply(lambda x: [i.replace(\" \",\"\") for i in x])\n", "movies['cast'] = movies['cast'].apply(lambda x: [i.replace(\" \",\"\") for i in x])\n", "movies['crew'] = movies['crew'].apply(lambda x: [i.replace(\" \",\"\") for i in x])\n" ] }, { "cell_type": "code", "execution_count": 29, "id": "2001e589", "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", "
movie_idtitleoverviewgenreskeywordscastcrew
019995Avatar[In, the, 22nd, century,, a, paraplegic, Marin...[Action, Adventure, Fantasy, ScienceFiction][cultureclash, future, spacewar, spacecolony, ...[SamWorthington, ZoeSaldana, SigourneyWeaver][JamesCameron]
1285Pirates of the Caribbean: At World's End[Captain, Barbossa,, long, believed, to, be, d...[Adventure, Fantasy, Action][ocean, drugabuse, exoticisland, eastindiatrad...[JohnnyDepp, OrlandoBloom, KeiraKnightley][GoreVerbinski]
2206647Spectre[A, cryptic, message, from, Bond’s, past, send...[Action, Adventure, Crime][spy, basedonnovel, secretagent, sequel, mi6, ...[DanielCraig, ChristophWaltz, LéaSeydoux][SamMendes]
349026The Dark Knight Rises[Following, the, death, of, District, Attorney...[Action, Crime, Drama, Thriller][dccomics, crimefighter, terrorist, secretiden...[ChristianBale, MichaelCaine, GaryOldman][ChristopherNolan]
449529John Carter[John, Carter, is, a, war-weary,, former, mili...[Action, Adventure, ScienceFiction][basedonnovel, mars, medallion, spacetravel, p...[TaylorKitsch, LynnCollins, SamanthaMorton][AndrewStanton]
\n", "
" ], "text/plain": [ " movie_id title \\\n", "0 19995 Avatar \n", "1 285 Pirates of the Caribbean: At World's End \n", "2 206647 Spectre \n", "3 49026 The Dark Knight Rises \n", "4 49529 John Carter \n", "\n", " overview \\\n", "0 [In, the, 22nd, century,, a, paraplegic, Marin... \n", "1 [Captain, Barbossa,, long, believed, to, be, d... \n", "2 [A, cryptic, message, from, Bond’s, past, send... \n", "3 [Following, the, death, of, District, Attorney... \n", "4 [John, Carter, is, a, war-weary,, former, mili... \n", "\n", " genres \\\n", "0 [Action, Adventure, Fantasy, ScienceFiction] \n", "1 [Adventure, Fantasy, Action] \n", "2 [Action, Adventure, Crime] \n", "3 [Action, Crime, Drama, Thriller] \n", "4 [Action, Adventure, ScienceFiction] \n", "\n", " keywords \\\n", "0 [cultureclash, future, spacewar, spacecolony, ... \n", "1 [ocean, drugabuse, exoticisland, eastindiatrad... \n", "2 [spy, basedonnovel, secretagent, sequel, mi6, ... \n", "3 [dccomics, crimefighter, terrorist, secretiden... \n", "4 [basedonnovel, mars, medallion, spacetravel, p... \n", "\n", " cast crew \n", "0 [SamWorthington, ZoeSaldana, SigourneyWeaver] [JamesCameron] \n", "1 [JohnnyDepp, OrlandoBloom, KeiraKnightley] [GoreVerbinski] \n", "2 [DanielCraig, ChristophWaltz, LéaSeydoux] [SamMendes] \n", "3 [ChristianBale, MichaelCaine, GaryOldman] [ChristopherNolan] \n", "4 [TaylorKitsch, LynnCollins, SamanthaMorton] [AndrewStanton] " ] }, "execution_count": 29, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movies.head()\n" ] }, { "cell_type": "code", "execution_count": 30, "id": "a7e1c0fd", "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", "
movie_idtitleoverviewgenreskeywordscastcrewtags
019995Avatar[In, the, 22nd, century,, a, paraplegic, Marin...[Action, Adventure, Fantasy, ScienceFiction][cultureclash, future, spacewar, spacecolony, ...[SamWorthington, ZoeSaldana, SigourneyWeaver][JamesCameron][In, the, 22nd, century,, a, paraplegic, Marin...
1285Pirates of the Caribbean: At World's End[Captain, Barbossa,, long, believed, to, be, d...[Adventure, Fantasy, Action][ocean, drugabuse, exoticisland, eastindiatrad...[JohnnyDepp, OrlandoBloom, KeiraKnightley][GoreVerbinski][Captain, Barbossa,, long, believed, to, be, d...
2206647Spectre[A, cryptic, message, from, Bond’s, past, send...[Action, Adventure, Crime][spy, basedonnovel, secretagent, sequel, mi6, ...[DanielCraig, ChristophWaltz, LéaSeydoux][SamMendes][A, cryptic, message, from, Bond’s, past, send...
349026The Dark Knight Rises[Following, the, death, of, District, Attorney...[Action, Crime, Drama, Thriller][dccomics, crimefighter, terrorist, secretiden...[ChristianBale, MichaelCaine, GaryOldman][ChristopherNolan][Following, the, death, of, District, Attorney...
449529John Carter[John, Carter, is, a, war-weary,, former, mili...[Action, Adventure, ScienceFiction][basedonnovel, mars, medallion, spacetravel, p...[TaylorKitsch, LynnCollins, SamanthaMorton][AndrewStanton][John, Carter, is, a, war-weary,, former, mili...
\n", "
" ], "text/plain": [ " movie_id title \\\n", "0 19995 Avatar \n", "1 285 Pirates of the Caribbean: At World's End \n", "2 206647 Spectre \n", "3 49026 The Dark Knight Rises \n", "4 49529 John Carter \n", "\n", " overview \\\n", "0 [In, the, 22nd, century,, a, paraplegic, Marin... \n", "1 [Captain, Barbossa,, long, believed, to, be, d... \n", "2 [A, cryptic, message, from, Bond’s, past, send... \n", "3 [Following, the, death, of, District, Attorney... \n", "4 [John, Carter, is, a, war-weary,, former, mili... \n", "\n", " genres \\\n", "0 [Action, Adventure, Fantasy, ScienceFiction] \n", "1 [Adventure, Fantasy, Action] \n", "2 [Action, Adventure, Crime] \n", "3 [Action, Crime, Drama, Thriller] \n", "4 [Action, Adventure, ScienceFiction] \n", "\n", " keywords \\\n", "0 [cultureclash, future, spacewar, spacecolony, ... \n", "1 [ocean, drugabuse, exoticisland, eastindiatrad... \n", "2 [spy, basedonnovel, secretagent, sequel, mi6, ... \n", "3 [dccomics, crimefighter, terrorist, secretiden... \n", "4 [basedonnovel, mars, medallion, spacetravel, p... \n", "\n", " cast crew \\\n", "0 [SamWorthington, ZoeSaldana, SigourneyWeaver] [JamesCameron] \n", "1 [JohnnyDepp, OrlandoBloom, KeiraKnightley] [GoreVerbinski] \n", "2 [DanielCraig, ChristophWaltz, LéaSeydoux] [SamMendes] \n", "3 [ChristianBale, MichaelCaine, GaryOldman] [ChristopherNolan] \n", "4 [TaylorKitsch, LynnCollins, SamanthaMorton] [AndrewStanton] \n", "\n", " tags \n", "0 [In, the, 22nd, century,, a, paraplegic, Marin... \n", "1 [Captain, Barbossa,, long, believed, to, be, d... \n", "2 [A, cryptic, message, from, Bond’s, past, send... \n", "3 [Following, the, death, of, District, Attorney... \n", "4 [John, Carter, is, a, war-weary,, former, mili... " ] }, "execution_count": 30, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movies['tags'] = movies['overview'] + movies['genres'] + movies['keywords'] + movies['cast'] + movies['crew']\n", "movies.head()" ] }, { "cell_type": "code", "execution_count": 31, "id": "0d9526ac", "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", "
movie_idtitletags
019995Avatar[In, the, 22nd, century,, a, paraplegic, Marin...
1285Pirates of the Caribbean: At World's End[Captain, Barbossa,, long, believed, to, be, d...
2206647Spectre[A, cryptic, message, from, Bond’s, past, send...
349026The Dark Knight Rises[Following, the, death, of, District, Attorney...
449529John Carter[John, Carter, is, a, war-weary,, former, mili...
\n", "
" ], "text/plain": [ " movie_id title \\\n", "0 19995 Avatar \n", "1 285 Pirates of the Caribbean: At World's End \n", "2 206647 Spectre \n", "3 49026 The Dark Knight Rises \n", "4 49529 John Carter \n", "\n", " tags \n", "0 [In, the, 22nd, century,, a, paraplegic, Marin... \n", "1 [Captain, Barbossa,, long, believed, to, be, d... \n", "2 [A, cryptic, message, from, Bond’s, past, send... \n", "3 [Following, the, death, of, District, Attorney... \n", "4 [John, Carter, is, a, war-weary,, former, mili... " ] }, "execution_count": 31, "metadata": {}, "output_type": "execute_result" } ], "source": [ "new_df = movies[['movie_id','title','tags']]\n", "new_df.head()" ] }, { "cell_type": "code", "execution_count": 32, "id": "0c826327", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0 In the 22nd century, a paraplegic Marine is di...\n", "1 Captain Barbossa, long believed to be dead, ha...\n", "2 A cryptic message from Bond’s past sends him o...\n", "3 Following the death of District Attorney Harve...\n", "4 John Carter is a war-weary, former military ca...\n", " ... \n", "4804 El Mariachi just wants to play his guitar and ...\n", "4805 A newlywed couple's honeymoon is upended by th...\n", "4806 \"Signed, Sealed, Delivered\" introduces a dedic...\n", "4807 When ambitious New York attorney Sam is sent t...\n", "4808 Ever since the second grade when he first saw ...\n", "Name: tags, Length: 4806, dtype: object" ] }, "execution_count": 32, "metadata": {}, "output_type": "execute_result" } ], "source": [ "new_df['tags'].apply(lambda x:\" \".join(x))\n" ] }, { "cell_type": "code", "execution_count": 33, "id": "f5436f6a", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/tmp/ipykernel_20024/3089450492.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", " new_df['tags'] = new_df['tags'].apply(lambda x:\" \".join(x))\n" ] } ], "source": [ "new_df['tags'] = new_df['tags'].apply(lambda x:\" \".join(x))" ] }, { "cell_type": "code", "execution_count": 34, "id": "c8333093", "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", "
movie_idtitletags
019995AvatarIn the 22nd century, a paraplegic Marine is di...
1285Pirates of the Caribbean: At World's EndCaptain Barbossa, long believed to be dead, ha...
2206647SpectreA cryptic message from Bond’s past sends him o...
349026The Dark Knight RisesFollowing the death of District Attorney Harve...
449529John CarterJohn Carter is a war-weary, former military ca...
\n", "
" ], "text/plain": [ " movie_id title \\\n", "0 19995 Avatar \n", "1 285 Pirates of the Caribbean: At World's End \n", "2 206647 Spectre \n", "3 49026 The Dark Knight Rises \n", "4 49529 John Carter \n", "\n", " tags \n", "0 In the 22nd century, a paraplegic Marine is di... \n", "1 Captain Barbossa, long believed to be dead, ha... \n", "2 A cryptic message from Bond’s past sends him o... \n", "3 Following the death of District Attorney Harve... \n", "4 John Carter is a war-weary, former military ca... " ] }, "execution_count": 34, "metadata": {}, "output_type": "execute_result" } ], "source": [ "new_df.head()" ] }, { "cell_type": "code", "execution_count": 35, "id": "e70a0f37", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'In the 22nd century, a paraplegic Marine is dispatched to the moon Pandora on a unique mission, but becomes torn between following orders and protecting an alien civilization. Action Adventure Fantasy ScienceFiction cultureclash future spacewar spacecolony society spacetravel futuristic romance space alien tribe alienplanet cgi marine soldier battle loveaffair antiwar powerrelations mindandsoul 3d SamWorthington ZoeSaldana SigourneyWeaver JamesCameron'" ] }, "execution_count": 35, "metadata": {}, "output_type": "execute_result" } ], "source": [ "new_df['tags'][0]" ] }, { "cell_type": "code", "execution_count": 36, "id": "c4c11c16", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0 in the 22nd century, a paraplegic marine is di...\n", "1 captain barbossa, long believed to be dead, ha...\n", "2 a cryptic message from bond’s past sends him o...\n", "3 following the death of district attorney harve...\n", "4 john carter is a war-weary, former military ca...\n", " ... \n", "4804 el mariachi just wants to play his guitar and ...\n", "4805 a newlywed couple's honeymoon is upended by th...\n", "4806 \"signed, sealed, delivered\" introduces a dedic...\n", "4807 when ambitious new york attorney sam is sent t...\n", "4808 ever since the second grade when he first saw ...\n", "Name: tags, Length: 4806, dtype: object" ] }, "execution_count": 36, "metadata": {}, "output_type": "execute_result" } ], "source": [ "new_df['tags'].apply(lambda x: x.lower())\n" ] }, { "cell_type": "code", "execution_count": 37, "id": "95514440", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/tmp/ipykernel_20024/1380776331.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", " new_df['tags'] = new_df['tags'].apply(lambda x: x.lower())\n" ] } ], "source": [ "new_df['tags'] = new_df['tags'].apply(lambda x: x.lower())" ] }, { "cell_type": "code", "execution_count": 38, "id": "581e04a3", "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", "
movie_idtitletags
019995Avatarin the 22nd century, a paraplegic marine is di...
1285Pirates of the Caribbean: At World's Endcaptain barbossa, long believed to be dead, ha...
2206647Spectrea cryptic message from bond’s past sends him o...
349026The Dark Knight Risesfollowing the death of district attorney harve...
449529John Carterjohn carter is a war-weary, former military ca...
\n", "
" ], "text/plain": [ " movie_id title \\\n", "0 19995 Avatar \n", "1 285 Pirates of the Caribbean: At World's End \n", "2 206647 Spectre \n", "3 49026 The Dark Knight Rises \n", "4 49529 John Carter \n", "\n", " tags \n", "0 in the 22nd century, a paraplegic marine is di... \n", "1 captain barbossa, long believed to be dead, ha... \n", "2 a cryptic message from bond’s past sends him o... \n", "3 following the death of district attorney harve... \n", "4 john carter is a war-weary, former military ca... " ] }, "execution_count": 38, "metadata": {}, "output_type": "execute_result" } ], "source": [ "new_df.head()" ] }, { "cell_type": "code", "execution_count": 39, "id": "34a7781f", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'in the 22nd century, a paraplegic marine is dispatched to the moon pandora on a unique mission, but becomes torn between following orders and protecting an alien civilization. action adventure fantasy sciencefiction cultureclash future spacewar spacecolony society spacetravel futuristic romance space alien tribe alienplanet cgi marine soldier battle loveaffair antiwar powerrelations mindandsoul 3d samworthington zoesaldana sigourneyweaver jamescameron'" ] }, "execution_count": 39, "metadata": {}, "output_type": "execute_result" } ], "source": [ "new_df['tags'][0]" ] }, { "cell_type": "code", "execution_count": 40, "id": "0562ee0c", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "\"captain barbossa, long believed to be dead, has come back to life and is headed to the edge of the earth with will turner and elizabeth swann. but nothing is quite as it seems. adventure fantasy action ocean drugabuse exoticisland eastindiatradingcompany loveofone'slife traitor shipwreck strongwoman ship alliance calypso afterlife fighter pirate swashbuckler aftercreditsstinger johnnydepp orlandobloom keiraknightley goreverbinski\"" ] }, "execution_count": 40, "metadata": {}, "output_type": "execute_result" } ], "source": [ "new_df['tags'][1]" ] }, { "cell_type": "code", "execution_count": 41, "id": "761f22ce", "metadata": {}, "outputs": [], "source": [ "from sklearn.feature_extraction.text import CountVectorizer\n", "cv = CountVectorizer(max_features=5000,stop_words='english')" ] }, { "cell_type": "code", "execution_count": 42, "id": "2bdafac3", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([[0, 0, 0, ..., 0, 0, 0],\n", " [0, 0, 0, ..., 0, 0, 0],\n", " [0, 0, 0, ..., 0, 0, 0],\n", " ...,\n", " [0, 0, 0, ..., 0, 0, 0],\n", " [0, 0, 0, ..., 0, 0, 0],\n", " [0, 0, 0, ..., 0, 0, 0]])" ] }, "execution_count": 42, "metadata": {}, "output_type": "execute_result" } ], "source": [ "cv.fit_transform(new_df['tags']).toarray()" ] }, { "cell_type": "code", "execution_count": 43, "id": "40cf4a5a", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(4806, 5000)" ] }, "execution_count": 43, "metadata": {}, "output_type": "execute_result" } ], "source": [ "vectors = cv.fit_transform(new_df['tags']).toarray()\n", "vectors.shape" ] }, { "cell_type": "code", "execution_count": 44, "id": "07afe297", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([0, 0, 0, ..., 0, 0, 0])" ] }, "execution_count": 44, "metadata": {}, "output_type": "execute_result" } ], "source": [ "vectors[0]" ] }, { "cell_type": "code", "execution_count": 45, "id": "480adff1", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "5000" ] }, "execution_count": 45, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(cv.get_feature_names_out())" ] }, { "cell_type": "code", "execution_count": 46, "id": "d51f0264", "metadata": {}, "outputs": [], "source": [ "import nltk\n", "from nltk.stem.porter import PorterStemmer\n", "ps = PorterStemmer()" ] }, { "cell_type": "code", "execution_count": 47, "id": "2774d0a7", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'act'" ] }, "execution_count": 47, "metadata": {}, "output_type": "execute_result" } ], "source": [ "ps.stem('acting')" ] }, { "cell_type": "code", "execution_count": 48, "id": "fdefd094", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0 in the 22nd century, a parapleg marin is dispa...\n", "1 captain barbossa, long believ to be dead, ha c...\n", "2 a cryptic messag from bond’ past send him on a...\n", "3 follow the death of district attorney harvey d...\n", "4 john carter is a war-weary, former militari ca...\n", " ... \n", "4804 el mariachi just want to play hi guitar and ca...\n", "4805 a newlyw couple' honeymoon is upend by the arr...\n", "4806 \"signed, sealed, delivered\" introduc a dedic q...\n", "4807 when ambiti new york attorney sam is sent to s...\n", "4808 ever sinc the second grade when he first saw h...\n", "Name: tags, Length: 4806, dtype: object" ] }, "execution_count": 48, "metadata": {}, "output_type": "execute_result" } ], "source": [ "def stem(text):\n", " y=[]\n", " for i in text.split():\n", " y.append(ps.stem(i))\n", " return \" \".join(y) \n", "new_df['tags'].apply(stem)" ] }, { "cell_type": "code", "execution_count": 49, "id": "e38d78e0", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/tmp/ipykernel_20024/3213734980.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", " new_df['tags'] = new_df['tags'].apply(stem)\n" ] } ], "source": [ "new_df['tags'] = new_df['tags'].apply(stem)" ] }, { "cell_type": "code", "execution_count": 50, "id": "5002ecb1", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(4806, 5000)" ] }, "execution_count": 50, "metadata": {}, "output_type": "execute_result" } ], "source": [ "vectors.shape" ] }, { "cell_type": "code", "execution_count": 51, "id": "220ba8ce", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([[1. , 0.08980265, 0.05986843, ..., 0.02457366, 0.02777778,\n", " 0. ],\n", " [0.08980265, 1. , 0.06451613, ..., 0.02648136, 0. ,\n", " 0. ],\n", " [0.05986843, 0.06451613, 1. , ..., 0.02648136, 0. ,\n", " 0. ],\n", " ...,\n", " [0.02457366, 0.02648136, 0.02648136, ..., 1. , 0.07372098,\n", " 0.04721922],\n", " [0.02777778, 0. , 0. , ..., 0.07372098, 1. ,\n", " 0.05337605],\n", " [0. , 0. , 0. , ..., 0.04721922, 0.05337605,\n", " 1. ]])" ] }, "execution_count": 51, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from sklearn.metrics.pairwise import cosine_similarity\n", "cosine_similarity(vectors)" ] }, { "cell_type": "code", "execution_count": 52, "id": "a5cdb148", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(4806, 4806)" ] }, "execution_count": 52, "metadata": {}, "output_type": "execute_result" } ], "source": [ "cosine_similarity(vectors).shape" ] }, { "cell_type": "code", "execution_count": 53, "id": "e6460b49", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([1. , 0.08980265, 0.05986843, ..., 0.02457366, 0.02777778,\n", " 0. ])" ] }, "execution_count": 53, "metadata": {}, "output_type": "execute_result" } ], "source": [ "similarity = cosine_similarity(vectors)\n", "similarity[0]" ] }, { "cell_type": "code", "execution_count": 54, "id": "2e52ef99", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([0.08980265, 1. , 0.06451613, ..., 0.02648136, 0. ,\n", " 0. ])" ] }, "execution_count": 54, "metadata": {}, "output_type": "execute_result" } ], "source": [ "similarity[1]" ] }, { "cell_type": "code", "execution_count": 55, "id": "95dc5165", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[(0, 1.0),\n", " (1, 0.08980265101338746),\n", " (2, 0.05986843400892497),\n", " (3, 0.03928371006591931),\n", " (4, 0.1800205749557739),\n", " (5, 0.11669000700233413),\n", " (6, 0.022893427324781505),\n", " (7, 0.17391639824998364),\n", " (8, 0.06189844605901729),\n", " (9, 0.07624928516630233),\n", " (10, 0.1160517706371319),\n", " (11, 0.08006407690254357),\n", " (12, 0.09622504486493762),\n", " (13, 0.04714045207910317),\n", " (14, 0.11433239009500587),\n", " (15, 0.050832856777534886),\n", " (16, 0.08111071056538127),\n", " (17, 0.1481668148335556),\n", " (18, 0.11135885079684349),\n", " (19, 0.08535791995526398),\n", " (20, 0.05735393346764043),\n", " (21, 0.09284766908852593),\n", " (22, 0.06804138174397717),\n", " (23, 0.09622504486493762),\n", " (24, 0.05479966243511909),\n", " (25, 0.03823595564509362),\n", " (26, 0.1690308509457033),\n", " (27, 0.18314741859825204),\n", " (28, 0.12379689211803457),\n", " (29, 0.07001400420140048),\n", " (30, 0.07216878364870322),\n", " (31, 0.15748519708717798),\n", " (32, 0.08989331499509895),\n", " (33, 0.10206207261596575),\n", " (34, 0.0),\n", " (35, 0.11180339887498947),\n", " (36, 0.1917988185229168),\n", " (37, 0.08333333333333333),\n", " (38, 0.062017367294604234),\n", " (39, 0.08703882797784893),\n", " (40, 0.05555555555555555),\n", " (41, 0.14433756729740646),\n", " (42, 0.0),\n", " (43, 0.09622504486493763),\n", " (44, 0.04042260417272216),\n", " (45, 0.0890870806374748),\n", " (46, 0.17407765595569785),\n", " (47, 0.21339479988815996),\n", " (48, 0.0668153104781061),\n", " (49, 0.0629940788348712),\n", " (50, 0.11973686801784994),\n", " (51, 0.08535791995526398),\n", " (52, 0.17149858514250882),\n", " (53, 0.04914731871829904),\n", " (54, 0.034752402342845795),\n", " (55, 0.07749842582921285),\n", " (56, 0.14213381090374028),\n", " (57, 0.028583097523751468),\n", " (58, 0.046225016352102424),\n", " (59, 0.07856742013183862),\n", " (60, 0.02817180849095055),\n", " (61, 0.21821789023599236),\n", " (62, 0.08084520834544431),\n", " (63, 0.09072184232530289),\n", " (64, 0.030949223029508643),\n", " (65, 0.020672455764868078),\n", " (66, 0.02457365935914952),\n", " (67, 0.1796053020267749),\n", " (68, 0.13074409009212268),\n", " (69, 0.051298917604257706),\n", " (70, 0.08574929257125441),\n", " (71, 0.08006407690254357),\n", " (72, 0.1217161238900369),\n", " (73, 0.03726779962499649),\n", " (74, 0.22360679774997894),\n", " (75, 0.09284766908852593),\n", " (76, 0.07715167498104596),\n", " (77, 0.014617633655117155),\n", " (78, 0.05270462766947299),\n", " (79, 0.07715167498104596),\n", " (80, 0.034020690871988585),\n", " (81, 0.11547005383792512),\n", " (82, 0.08219949365267865),\n", " (83, 0.2187974872468418),\n", " (84, 0.14360673947588817),\n", " (85, 0.10425720702853739),\n", " (86, 0.08703882797784893),\n", " (87, 0.11433239009500587),\n", " (88, 0.08980265101338746),\n", " (89, 0.06060606060606061),\n", " (90, 0.06415002990995841),\n", " (91, 0.15474611514754322),\n", " (92, 0.06933752452815364),\n", " (93, 0.049690399499995326),\n", " (94, 0.16343011261515333),\n", " (95, 0.12422599874998831),\n", " (96, 0.08838834764831843),\n", " (97, 0.07372097807744857),\n", " (98, 0.08838834764831843),\n", " (99, 0.029012942659282975),\n", " (100, 0.07273929674533079),\n", " (101, 0.08703882797784893),\n", " (102, 0.11037769642208699),\n", " (103, 0.08753762190648169),\n", " (104, 0.057166195047502935),\n", " (105, 0.10660035817780521),\n", " (106, 0.044151078568834795),\n", " (107, 0.09072184232530289),\n", " (108, 0.16666666666666666),\n", " (109, 0.07856742013183862),\n", " (110, 0.02457365935914952),\n", " (111, 0.1496710850223124),\n", " (112, 0.08980265101338746),\n", " (113, 0.052057920629535355),\n", " (114, 0.05143444998736397),\n", " (115, 0.05407380704358751),\n", " (116, 0.0563436169819011),\n", " (117, 0.05986843400892497),\n", " (118, 0.017376201171422898),\n", " (119, 0.048112522432468816),\n", " (120, 0.0),\n", " (121, 0.08980265101338746),\n", " (122, 0.0944911182523068),\n", " (123, 0.12155415958157878),\n", " (124, 0.06741998624632421),\n", " (125, 0.07909649964604158),\n", " (126, 0.11433239009500587),\n", " (127, 0.13471506281091267),\n", " (128, 0.0),\n", " (129, 0.10411584125907071),\n", " (130, 0.0314970394174356),\n", " (131, 0.10959932487023819),\n", " (132, 0.0445435403187374),\n", " (133, 0.03268602252303067),\n", " (134, 0.13333333333333333),\n", " (135, 0.0),\n", " (136, 0.025125945381480302),\n", " (137, 0.034020690871988585),\n", " (138, 0.08111071056538127),\n", " (139, 0.10669739994407998),\n", " (140, 0.050251890762960605),\n", " (141, 0.11180339887498947),\n", " (142, 0.09622504486493762),\n", " (143, 0.06868028197434452),\n", " (144, 0.05479966243511909),\n", " (145, 0.022075539284417398),\n", " (146, 0.017099639201419235),\n", " (147, 0.06189844605901729),\n", " (148, 0.10425720702853739),\n", " (149, 0.16933350266692065),\n", " (150, 0.18750000000000003),\n", " (151, 0.20211302086361077),\n", " (152, 0.0629940788348712),\n", " (153, 0.08535791995526398),\n", " (154, 0.03268602252303067),\n", " (155, 0.0),\n", " (156, 0.06565321642986127),\n", " (157, 0.10425720702853739),\n", " (158, 0.15075567228888181),\n", " (159, 0.06666666666666667),\n", " (160, 0.09558988911273406),\n", " (161, 0.034752402342845795),\n", " (162, 0.036369648372665396),\n", " (163, 0.053376051268362375),\n", " (164, 0.09128709291752768),\n", " (165, 0.04914731871829904),\n", " (166, 0.1178511301977579),\n", " (167, 0.06804138174397717),\n", " (168, 0.15617376188860607),\n", " (169, 0.11785113019775792),\n", " (170, 0.09072184232530289),\n", " (171, 0.029012942659282975),\n", " (172, 0.14907119849998596),\n", " (173, 0.02457365935914952),\n", " (174, 0.10959932487023819),\n", " (175, 0.050832856777534886),\n", " (176, 0.030429030972509225),\n", " (177, 0.0),\n", " (178, 0.025717224993681984),\n", " (179, 0.07647191129018724),\n", " (180, 0.023809523809523808),\n", " (181, 0.023338001400466827),\n", " (182, 0.10540925533894598),\n", " (183, 0.07362101738323101),\n", " (184, 0.1800205749557739),\n", " (185, 0.05479966243511909),\n", " (186, 0.03984095364447979),\n", " (187, 0.1388888888888889),\n", " (188, 0.022075539284417398),\n", " (189, 0.08084520834544431),\n", " (190, 0.08268982305947231),\n", " (191, 0.050832856777534886),\n", " (192, 0.0),\n", " (193, 0.08679260732054925),\n", " (194, 0.0),\n", " (195, 0.06415002990995841),\n", " (196, 0.05802588531856595),\n", " (197, 0.04714045207910317),\n", " (198, 0.05892556509887895),\n", " (199, 0.11556254088025605),\n", " (200, 0.07856742013183862),\n", " (201, 0.0),\n", " (202, 0.034020690871988585),\n", " (203, 0.08703882797784893),\n", " (204, 0.026352313834736494),\n", " (205, 0.08333333333333333),\n", " (206, 0.09558988911273406),\n", " (207, 0.08333333333333333),\n", " (208, 0.16666666666666666),\n", " (209, 0.03823595564509362),\n", " (210, 0.05407380704358751),\n", " (211, 0.027036903521793755),\n", " (212, 0.07624928516630233),\n", " (213, 0.06401843996644799),\n", " (214, 0.028583097523751468),\n", " (215, 0.07216878364870322),\n", " (216, 0.06415002990995841),\n", " (217, 0.045360921162651446),\n", " (218, 0.043033148291193514),\n", " (219, 0.06537204504606134),\n", " (220, 0.18257418583505536),\n", " (221, 0.024310831916315757),\n", " (222, 0.0890870806374748),\n", " (223, 0.08219949365267865),\n", " (224, 0.0625),\n", " (225, 0.052057920629535355),\n", " (226, 0.029462782549439476),\n", " (227, 0.09128709291752768),\n", " (228, 0.1256297269074015),\n", " (229, 0.07647191129018724),\n", " (230, 0.08268982305947231),\n", " (231, 0.0),\n", " (232, 0.1178511301977579),\n", " (233, 0.10660035817780521),\n", " (234, 0.06741998624632421),\n", " (235, 0.05892556509887895),\n", " (236, 0.0944911182523068),\n", " (237, 0.06950480468569159),\n", " (238, 0.12309149097933272),\n", " (239, 0.10499013139145198),\n", " (240, 0.050832856777534886),\n", " (241, 0.08333333333333333),\n", " (242, 0.09284766908852593),\n", " (243, 0.09829463743659808),\n", " (244, 0.06189844605901729),\n", " (245, 0.08980265101338746),\n", " (246, 0.06509445549041193),\n", " (247, 0.0),\n", " (248, 0.046225016352102424),\n", " (249, 0.14213381090374028),\n", " (250, 0.0),\n", " (251, 0.041666666666666664),\n", " (252, 0.022473328748774737),\n", " (253, 0.06509445549041194),\n", " (254, 0.08219949365267865),\n", " (255, 0.0),\n", " (256, 0.08084520834544431),\n", " (257, 0.08451542547285165),\n", " (258, 0.023112508176051212),\n", " (259, 0.0629940788348712),\n", " (260, 0.24759378423606915),\n", " (261, 0.025125945381480302),\n", " (262, 0.07293249574894728),\n", " (263, 0.10206207261596575),\n", " (264, 0.0),\n", " (265, 0.029012942659282975),\n", " (266, 0.10959932487023819),\n", " (267, 0.07273929674533079),\n", " (268, 0.027036903521793755),\n", " (269, 0.03268602252303067),\n", " (270, 0.10050378152592121),\n", " (271, 0.07808688094430304),\n", " (272, 0.029934217004462485),\n", " (273, 0.024056261216234408),\n", " (274, 0.0798188571017626),\n", " (275, 0.12379689211803457),\n", " (276, 0.06666666666666667),\n", " (277, 0.06565321642986127),\n", " (278, 0.1256297269074015),\n", " (279, 0.10286889997472794),\n", " (280, 0.0),\n", " (281, 0.07216878364870322),\n", " (282, 0.029934217004462485),\n", " (283, 0.0),\n", " (284, 0.02021130208636108),\n", " (285, 0.022473328748774737),\n", " (286, 0.022075539284417398),\n", " (287, 0.027036903521793755),\n", " (288, 0.0),\n", " (289, 0.049690399499995326),\n", " (290, 0.06666666666666667),\n", " (291, 0.05555555555555555),\n", " (292, 0.1),\n", " (293, 0.0314970394174356),\n", " (294, 0.1178511301977579),\n", " (295, 0.10814761408717502),\n", " (296, 0.03955938860646177),\n", " (297, 0.047619047619047616),\n", " (298, 0.0),\n", " (299, 0.041030496993110906),\n", " (300, 0.18220272220337375),\n", " (301, 0.1805787796286538),\n", " (302, 0.05892556509887895),\n", " (303, 0.028583097523751468),\n", " (304, 0.07106690545187014),\n", " (305, 0.19050019050028574),\n", " (306, 0.09284766908852593),\n", " (307, 0.10314212462587934),\n", " (308, 0.06950480468569159),\n", " (309, 0.06537204504606134),\n", " (310, 0.03553345272593507),\n", " (311, 0.15430334996209188),\n", " (312, 0.1111111111111111),\n", " (313, 0.07856742013183862),\n", " (314, 0.0),\n", " (315, 0.08980265101338746),\n", " (316, 0.0),\n", " (317, 0.0),\n", " (318, 0.0),\n", " (319, 0.07106690545187014),\n", " (320, 0.03268602252303067),\n", " (321, 0.0),\n", " (322, 0.2222222222222222),\n", " (323, 0.03268602252303067),\n", " (324, 0.026028960314767677),\n", " (325, 0.10910894511799618),\n", " (326, 0.05892556509887895),\n", " (327, 0.029012942659282975),\n", " (328, 0.0),\n", " (329, 0.08219949365267865),\n", " (330, 0.1111111111111111),\n", " (331, 0.049690399499995326),\n", " (332, 0.14291548761875733),\n", " (333, 0.030429030972509225),\n", " (334, 0.10540925533894598),\n", " (335, 0.05555555555555555),\n", " (336, 0.07273929674533079),\n", " (337, 0.023809523809523808),\n", " (338, 0.0),\n", " (339, 0.0563436169819011),\n", " (340, 0.052057920629535355),\n", " (341, 0.06085806194501845),\n", " (342, 0.13471506281091267),\n", " (343, 0.0222717701593687),\n", " (344, 0.030949223029508643),\n", " (345, 0.023338001400466827),\n", " (346, 0.0),\n", " (347, 0.0),\n", " (348, 0.06537204504606134),\n", " (349, 0.09128709291752768),\n", " (350, 0.05407380704358751),\n", " (351, 0.0),\n", " (352, 0.029462782549439476),\n", " (353, 0.023338001400466827),\n", " (354, 0.0),\n", " (355, 0.03955938860646177),\n", " (356, 0.09128709291752768),\n", " (357, 0.0),\n", " (358, 0.06537204504606134),\n", " (359, 0.034020690871988585),\n", " (360, 0.0),\n", " (361, 0.05555555555555555),\n", " (362, 0.09622504486493762),\n", " (363, 0.09072184232530289),\n", " (364, 0.025717224993681984),\n", " (365, 0.07905694150420949),\n", " (366, 0.05802588531856595),\n", " (367, 0.0),\n", " (368, 0.13333333333333333),\n", " (369, 0.09284766908852593),\n", " (370, 0.05555555555555555),\n", " (371, 0.10166571355506977),\n", " (372, 0.05270462766947299),\n", " (373, 0.17766726362967533),\n", " (374, 0.043768810953240846),\n", " (375, 0.042333375666730164),\n", " (376, 0.048112522432468816),\n", " (377, 0.0),\n", " (378, 0.0),\n", " (379, 0.05270462766947298),\n", " (380, 0.027777777777777776),\n", " (381, 0.0890870806374748),\n", " (382, 0.0),\n", " (383, 0.050251890762960605),\n", " (384, 0.032075014954979206),\n", " (385, 0.0),\n", " (386, 0.024056261216234408),\n", " (387, 0.027036903521793755),\n", " (388, 0.0),\n", " (389, 0.1),\n", " (390, 0.02817180849095055),\n", " (391, 0.060633906259083235),\n", " (392, 0.030949223029508643),\n", " (393, 0.0),\n", " (394, 0.025717224993681984),\n", " (395, 0.057166195047502935),\n", " (396, 0.023112508176051212),\n", " (397, 0.05479966243511909),\n", " (398, 0.0),\n", " (399, 0.025416428388767443),\n", " (400, 0.10206207261596575),\n", " (401, 0.030949223029508643),\n", " (402, 0.06085806194501845),\n", " (403, 0.10942202738310211),\n", " (404, 0.06666666666666667),\n", " (405, 0.030949223029508643),\n", " (406, 0.021516574145596757),\n", " (407, 0.021884405476620423),\n", " (408, 0.034752402342845795),\n", " (409, 0.0),\n", " (410, 0.09938079899999065),\n", " (411, 0.05802588531856595),\n", " (412, 0.10166571355506977),\n", " (413, 0.13699915608779772),\n", " (414, 0.03268602252303067),\n", " (415, 0.07027283689263064),\n", " (416, 0.05407380704358751),\n", " (417, 0.034020690871988585),\n", " (418, 0.036369648372665396),\n", " (419, 0.07537783614444091),\n", " (420, 0.1270821419438372),\n", " (421, 0.0),\n", " (422, 0.14547859349066158),\n", " (423, 0.05143444998736397),\n", " (424, 0.0401286176952564),\n", " (425, 0.07001400420140048),\n", " (426, 0.06108472217815261),\n", " (427, 0.029012942659282975),\n", " (428, 0.05892556509887897),\n", " (429, 0.0),\n", " (430, 0.052057920629535355),\n", " (431, 0.025717224993681984),\n", " (432, 0.12422599874998833),\n", " (433, 0.03268602252303067),\n", " (434, 0.0),\n", " (435, 0.03928371006591931),\n", " (436, 0.0),\n", " (437, 0.028583097523751468),\n", " (438, 0.02817180849095055),\n", " (439, 0.030429030972509225),\n", " (440, 0.027777777777777776),\n", " (441, 0.029934217004462485),\n", " (442, 0.047619047619047616),\n", " (443, 0.05802588531856595),\n", " (444, 0.0),\n", " (445, 0.02817180849095055),\n", " (446, 0.025717224993681984),\n", " (447, 0.023570226039551584),\n", " (448, 0.025416428388767443),\n", " (449, 0.057166195047502935),\n", " (450, 0.026028960314767677),\n", " (451, 0.026028960314767677),\n", " (452, 0.0314970394174356),\n", " (453, 0.026352313834736494),\n", " (454, 0.1228682967957476),\n", " (455, 0.024310831916315757),\n", " (456, 0.06933752452815364),\n", " (457, 0.08703882797784893),\n", " (458, 0.046676002800933654),\n", " (459, 0.03553345272593507),\n", " (460, 0.027777777777777776),\n", " (461, 0.1911797782254681),\n", " (462, 0.0),\n", " (463, 0.034752402342845795),\n", " (464, 0.0),\n", " (465, 0.0),\n", " (466, 0.20851441405707477),\n", " (467, 0.08989331499509895),\n", " (468, 0.029934217004462485),\n", " (469, 0.06933752452815364),\n", " (470, 0.048621663832631515),\n", " (471, 0.08111071056538127),\n", " (472, 0.08333333333333333),\n", " (473, 0.10166571355506977),\n", " (474, 0.0),\n", " (475, 0.06741998624632421),\n", " (476, 0.10660035817780521),\n", " (477, 0.0),\n", " (478, 0.03928371006591931),\n", " (479, 0.09375732507716866),\n", " (480, 0.052057920629535355),\n", " (481, 0.0),\n", " (482, 0.029934217004462485),\n", " (483, 0.12830005981991682),\n", " (484, 0.034020690871988585),\n", " (485, 0.0563436169819011),\n", " (486, 0.05773502691896257),\n", " (487, 0.13900960937138318),\n", " (488, 0.07548513560963971),\n", " (489, 0.0),\n", " (490, 0.14907119849998596),\n", " (491, 0.08989331499509895),\n", " (492, 0.06189844605901729),\n", " (493, 0.01924500897298752),\n", " (494, 0.0),\n", " (495, 0.2132007163556104),\n", " (496, 0.0),\n", " (497, 0.0),\n", " (498, 0.06804138174397717),\n", " (499, 0.0),\n", " (500, 0.02817180849095055),\n", " (501, 0.08679260732054925),\n", " (502, 0.15075567228888181),\n", " (503, 0.08333333333333333),\n", " (504, 0.0),\n", " (505, 0.14213381090374028),\n", " (506, 0.036369648372665396),\n", " (507, 0.2472066162365221),\n", " (508, 0.11433239009500587),\n", " (509, 0.025717224993681984),\n", " (510, 0.10411584125907071),\n", " (511, 0.0944911182523068),\n", " (512, 0.05986843400892497),\n", " (513, 0.1111111111111111),\n", " (514, 0.05802588531856595),\n", " (515, 0.026688025634181187),\n", " (516, 0.025416428388767443),\n", " (517, 0.0),\n", " (518, 0.05479966243511909),\n", " (519, 0.0),\n", " (520, 0.0),\n", " (521, 0.028583097523751468),\n", " (522, 0.0),\n", " (523, 0.05143444998736397),\n", " (524, 0.0),\n", " (525, 0.02457365935914952),\n", " (526, 0.0),\n", " (527, 0.0),\n", " (528, 0.023809523809523808),\n", " (529, 0.1270821419438372),\n", " (530, 0.1),\n", " (531, 0.050251890762960605),\n", " (532, 0.022680460581325723),\n", " (533, 0.06950480468569159),\n", " (534, 0.08333333333333333),\n", " (535, 0.10814761408717502),\n", " (536, 0.07624928516630233),\n", " (537, 0.06950480468569159),\n", " (538, 0.0),\n", " (539, 0.25724787771376323),\n", " (540, 0.05555555555555555),\n", " (541, 0.08989331499509895),\n", " (542, 0.03984095364447979),\n", " (543, 0.07715167498104596),\n", " (544, 0.05986843400892497),\n", " (545, 0.02817180849095055),\n", " (546, 0.07106690545187014),\n", " (547, 0.08838834764831843),\n", " (548, 0.0),\n", " (549, 0.12422599874998833),\n", " (550, 0.02817180849095055),\n", " (551, 0.043768810953240846),\n", " (552, 0.0),\n", " (553, 0.0314970394174356),\n", " (554, 0.0),\n", " (555, 0.049029033784546004),\n", " (556, 0.028583097523751468),\n", " (557, 0.14291548761875733),\n", " (558, 0.0),\n", " (559, 0.032075014954979206),\n", " (560, 0.045360921162651446),\n", " (561, 0.036369648372665396),\n", " (562, 0.0),\n", " (563, 0.027036903521793755),\n", " (564, 0.1),\n", " (565, 0.045360921162651446),\n", " (566, 0.024310831916315757),\n", " (567, 0.029934217004462485),\n", " (568, 0.14291548761875733),\n", " (569, 0.024056261216234408),\n", " (570, 0.07453559924999298),\n", " (571, 0.021698151830137312),\n", " (572, 0.08399210511316159),\n", " (573, 0.0222717701593687),\n", " (574, 0.023809523809523808),\n", " (575, 0.0563436169819011),\n", " (576, 0.028583097523751468),\n", " (577, 0.15214515486254612),\n", " (578, 0.04714045207910317),\n", " (579, 0.1217161238900369),\n", " (580, 0.024845199749997663),\n", " (581, 0.16343011261515333),\n", " (582, 0.2405626121623441),\n", " (583, 0.050832856777534886),\n", " (584, 0.048112522432468816),\n", " (585, 0.0),\n", " (586, 0.044946657497549475),\n", " (587, 0.07905694150420949),\n", " (588, 0.028583097523751468),\n", " (589, 0.09724332766526303),\n", " (590, 0.034752402342845795),\n", " (591, 0.07715167498104596),\n", " (592, 0.026688025634181187),\n", " (593, 0.0),\n", " (594, 0.05479966243511909),\n", " (595, 0.13518451760896877),\n", " (596, 0.09523809523809523),\n", " (597, 0.057166195047502935),\n", " (598, 0.03928371006591931),\n", " (599, 0.03316790634033297),\n", " (600, 0.07142857142857142),\n", " (601, 0.036588086663230115),\n", " (602, 0.0445435403187374),\n", " (603, 0.057166195047502935),\n", " (604, 0.06950480468569159),\n", " (605, 0.0),\n", " (606, 0.0),\n", " (607, 0.06401843996644799),\n", " (608, 0.0),\n", " (609, 0.04714045207910317),\n", " (610, 0.05976143046671968),\n", " (611, 0.024310831916315757),\n", " (612, 0.07001400420140048),\n", " (613, 0.03823595564509362),\n", " (614, 0.05986843400892497),\n", " (615, 0.03268602252303067),\n", " (616, 0.0),\n", " (617, 0.05479966243511909),\n", " (618, 0.09724332766526303),\n", " (619, 0.0),\n", " (620, 0.0),\n", " (621, 0.06804138174397717),\n", " (622, 0.022075539284417398),\n", " (623, 0.0),\n", " (624, 0.12126781251816647),\n", " (625, 0.0314970394174356),\n", " (626, 0.08574929257125441),\n", " (627, 0.11470786693528086),\n", " (628, 0.0),\n", " (629, 0.049690399499995326),\n", " (630, 0.024845199749997663),\n", " (631, 0.026688025634181187),\n", " (632, 0.08111071056538127),\n", " (633, 0.023570226039551584),\n", " (634, 0.08574929257125441),\n", " (635, 0.07372097807744857),\n", " (636, 0.02817180849095055),\n", " (637, 0.052057920629535355),\n", " (638, 0.034752402342845795),\n", " (639, 0.0),\n", " (640, 0.050251890762960605),\n", " (641, 0.0),\n", " (642, 0.0),\n", " (643, 0.10540925533894598),\n", " (644, 0.057166195047502935),\n", " (645, 0.04714045207910317),\n", " (646, 0.0563436169819011),\n", " (647, 0.050832856777534886),\n", " (648, 0.0314970394174356),\n", " (649, 0.0),\n", " (650, 0.0),\n", " (651, 0.0),\n", " (652, 0.024056261216234408),\n", " (653, 0.12126781251816647),\n", " (654, 0.08830215713766959),\n", " (655, 0.025717224993681984),\n", " (656, 0.0),\n", " (657, 0.036588086663230115),\n", " (658, 0.053376051268362375),\n", " (659, 0.026688025634181187),\n", " (660, 0.10206207261596575),\n", " (661, 0.16798421022632318),\n", " (662, 0.0),\n", " (663, 0.0),\n", " (664, 0.06415002990995841),\n", " (665, 0.07808688094430304),\n", " (666, 0.05143444998736397),\n", " (667, 0.0),\n", " (668, 0.06950480468569159),\n", " (669, 0.03553345272593507),\n", " (670, 0.01756820922315766),\n", " (671, 0.05270462766947299),\n", " (672, 0.057166195047502935),\n", " (673, 0.022680460581325723),\n", " (674, 0.07624928516630233),\n", " (675, 0.050832856777534886),\n", " (676, 0.03268602252303067),\n", " (677, 0.026688025634181187),\n", " (678, 0.06189844605901729),\n", " (679, 0.0),\n", " (680, 0.08111071056538127),\n", " (681, 0.034020690871988585),\n", " (682, 0.023809523809523808),\n", " (683, 0.050251890762960605),\n", " (684, 0.0),\n", " (685, 0.03726779962499649),\n", " (686, 0.0),\n", " (687, 0.1178511301977579),\n", " (688, 0.050251890762960605),\n", " (689, 0.0),\n", " (690, 0.029012942659282975),\n", " (691, 0.1),\n", " (692, 0.11904761904761904),\n", " (693, 0.0),\n", " (694, 0.023338001400466827),\n", " (695, 0.06804138174397717),\n", " (696, 0.0),\n", " (697, 0.0),\n", " (698, 0.023338001400466827),\n", " (699, 0.0),\n", " (700, 0.030429030972509225),\n", " (701, 0.0629940788348712),\n", " (702, 0.023809523809523808),\n", " (703, 0.020672455764868078),\n", " (704, 0.07293249574894728),\n", " (705, 0.025125945381480302),\n", " (706, 0.025717224993681984),\n", " (707, 0.0),\n", " (708, 0.025125945381480302),\n", " (709, 0.0),\n", " (710, 0.044151078568834795),\n", " (711, 0.06537204504606134),\n", " (712, 0.0),\n", " (713, 0.027036903521793755),\n", " (714, 0.0),\n", " (715, 0.10425720702853739),\n", " (716, 0.034752402342845795),\n", " (717, 0.0),\n", " (718, 0.04578685464956301),\n", " (719, 0.0),\n", " (720, 0.027036903521793755),\n", " (721, 0.03268602252303067),\n", " (722, 0.0),\n", " (723, 0.026028960314767677),\n", " (724, 0.025717224993681984),\n", " (725, 0.0),\n", " (726, 0.0),\n", " (727, 0.03594425773447947),\n", " (728, 0.07453559924999299),\n", " (729, 0.0),\n", " (730, 0.01642215463607155),\n", " (731, 0.05407380704358751),\n", " (732, 0.07715167498104596),\n", " (733, 0.044151078568834795),\n", " (734, 0.049690399499995326),\n", " (735, 0.04914731871829904),\n", " (736, 0.03268602252303067),\n", " (737, 0.07905694150420949),\n", " (738, 0.0),\n", " (739, 0.03823595564509362),\n", " (740, 0.1301448015738384),\n", " (741, 0.05802588531856595),\n", " (742, 0.034020690871988585),\n", " (743, 0.025416428388767443),\n", " (744, 0.06666666666666667),\n", " (745, 0.06189844605901729),\n", " (746, 0.08574929257125441),\n", " (747, 0.023570226039551584),\n", " (748, 0.03823595564509362),\n", " (749, 0.0),\n", " (750, 0.050251890762960605),\n", " (751, 0.03726779962499649),\n", " (752, 0.07453559924999299),\n", " (753, 0.029012942659282975),\n", " (754, 0.13176156917368248),\n", " (755, 0.06401843996644799),\n", " (756, 0.029934217004462485),\n", " (757, 0.027399831217559546),\n", " (758, 0.025416428388767443),\n", " (759, 0.0),\n", " (760, 0.0),\n", " (761, 0.029462782549439476),\n", " (762, 0.032075014954979206),\n", " (763, 0.0),\n", " (764, 0.030949223029508643),\n", " (765, 0.0),\n", " (766, 0.0),\n", " (767, 0.049690399499995326),\n", " (768, 0.06454972243679027),\n", " (769, 0.03268602252303067),\n", " (770, 0.048621663832631515),\n", " (771, 0.0),\n", " (772, 0.0),\n", " (773, 0.10910894511799618),\n", " (774, 0.0445435403187374),\n", " (775, 0.08980265101338746),\n", " (776, 0.08333333333333333),\n", " (777, 0.11340230290662862),\n", " (778, 0.12858612496840993),\n", " (779, 0.0),\n", " (780, 0.0),\n", " (781, 0.10206207261596575),\n", " (782, 0.07537783614444091),\n", " (783, 0.034020690871988585),\n", " (784, 0.07624928516630233),\n", " (785, 0.09820927516479827),\n", " (786, 0.08838834764831843),\n", " (787, 0.08451542547285165),\n", " (788, 0.05143444998736397),\n", " (789, 0.0),\n", " (790, 0.07071067811865475),\n", " (791, 0.1),\n", " (792, 0.05802588531856595),\n", " (793, 0.05555555555555555),\n", " (794, 0.09128709291752768),\n", " (795, 0.022893427324781505),\n", " (796, 0.03726779962499649),\n", " (797, 0.0),\n", " (798, 0.0),\n", " (799, 0.09259259259259259),\n", " (800, 0.07856742013183862),\n", " (801, 0.0),\n", " (802, 0.0),\n", " (803, 0.050251890762960605),\n", " (804, 0.052057920629535355),\n", " (805, 0.05892556509887895),\n", " (806, 0.048621663832631515),\n", " (807, 0.053376051268362375),\n", " (808, 0.11785113019775793),\n", " (809, 0.022680460581325723),\n", " (810, 0.028583097523751468),\n", " (811, 0.022680460581325723),\n", " (812, 0.09072184232530289),\n", " (813, 0.10050378152592121),\n", " (814, 0.08980265101338746),\n", " (815, 0.023112508176051212),\n", " (816, 0.0445435403187374),\n", " (817, 0.027399831217559546),\n", " (818, 0.032075014954979206),\n", " (819, 0.0),\n", " (820, 0.01756820922315766),\n", " (821, 0.018294043331615058),\n", " (822, 0.0222717701593687),\n", " (823, 0.06189844605901729),\n", " (824, 0.0),\n", " (825, 0.0),\n", " (826, 0.03553345272593507),\n", " (827, 0.07453559924999299),\n", " (828, 0.027777777777777776),\n", " (829, 0.0),\n", " (830, 0.029934217004462485),\n", " (831, 0.049690399499995326),\n", " (832, 0.027399831217559546),\n", " (833, 0.049690399499995326),\n", " (834, 0.049690399499995326),\n", " (835, 0.026688025634181187),\n", " (836, 0.0668153104781061),\n", " (837, 0.028583097523751468),\n", " (838, 0.16666666666666666),\n", " (839, 0.0),\n", " (840, 0.06189844605901729),\n", " (841, 0.026028960314767677),\n", " (842, 0.0),\n", " (843, 0.06085806194501845),\n", " (844, 0.06085806194501845),\n", " (845, 0.0),\n", " (846, 0.0),\n", " (847, 0.05962847939999439),\n", " (848, 0.058520573598065284),\n", " (849, 0.0),\n", " (850, 0.08084520834544431),\n", " (851, 0.0),\n", " (852, 0.022893427324781505),\n", " (853, 0.0314970394174356),\n", " (854, 0.1126872339638022),\n", " (855, 0.027777777777777776),\n", " (856, 0.025717224993681984),\n", " (857, 0.0),\n", " (858, 0.04042260417272216),\n", " (859, 0.1178511301977579),\n", " (860, 0.017376201171422898),\n", " (861, 0.043768810953240846),\n", " (862, 0.028583097523751468),\n", " (863, 0.032075014954979206),\n", " (864, 0.046225016352102424),\n", " (865, 0.0),\n", " (866, 0.041666666666666664),\n", " (867, 0.0),\n", " (868, 0.02457365935914952),\n", " (869, 0.030949223029508643),\n", " (870, 0.10166571355506977),\n", " (871, 0.029012942659282975),\n", " (872, 0.0),\n", " (873, 0.046225016352102424),\n", " (874, 0.027036903521793755),\n", " (875, 0.05479966243511909),\n", " (876, 0.0),\n", " (877, 0.0),\n", " (878, 0.03553345272593507),\n", " (879, 0.0),\n", " (880, 0.03268602252303067),\n", " (881, 0.0),\n", " (882, 0.029012942659282975),\n", " (883, 0.029012942659282975),\n", " (884, 0.0),\n", " (885, 0.08333333333333333),\n", " (886, 0.022893427324781505),\n", " (887, 0.05555555555555555),\n", " (888, 0.049690399499995326),\n", " (889, 0.07066652533375734),\n", " (890, 0.0),\n", " (891, 0.0445435403187374),\n", " (892, 0.0),\n", " (893, 0.019920476822239894),\n", " (894, 0.08980265101338746),\n", " (895, 0.0),\n", " (896, 0.0),\n", " (897, 0.050251890762960605),\n", " (898, 0.10411584125907071),\n", " (899, 0.08703882797784893),\n", " (900, 0.1126872339638022),\n", " (901, 0.09284766908852593),\n", " (902, 0.027399831217559546),\n", " (903, 0.034020690871988585),\n", " (904, 0.023112508176051212),\n", " (905, 0.0),\n", " (906, 0.0),\n", " (907, 0.024310831916315757),\n", " (908, 0.07808688094430304),\n", " (909, 0.0),\n", " (910, 0.023112508176051212),\n", " (911, 0.024310831916315757),\n", " (912, 0.03333333333333333),\n", " (913, 0.0),\n", " (914, 0.03553345272593507),\n", " (915, 0.027036903521793755),\n", " (916, 0.0),\n", " (917, 0.030949223029508643),\n", " (918, 0.0),\n", " (919, 0.025125945381480302),\n", " (920, 0.1),\n", " (921, 0.0),\n", " (922, 0.0944911182523068),\n", " (923, 0.0),\n", " (924, 0.0),\n", " (925, 0.020833333333333332),\n", " (926, 0.0),\n", " (927, 0.0),\n", " (928, 0.0),\n", " (929, 0.05555555555555555),\n", " (930, 0.026352313834736494),\n", " (931, 0.18569533817705186),\n", " (932, 0.05143444998736397),\n", " (933, 0.10050378152592121),\n", " (934, 0.029462782549439476),\n", " (935, 0.10425720702853739),\n", " (936, 0.0),\n", " (937, 0.08838834764831843),\n", " (938, 0.0),\n", " (939, 0.1259881576697424),\n", " (940, 0.0),\n", " (941, 0.0314970394174356),\n", " (942, 0.20953951903123735),\n", " (943, 0.0),\n", " (944, 0.0),\n", " (945, 0.06666666666666667),\n", " (946, 0.026352313834736494),\n", " (947, 0.0),\n", " (948, 0.0),\n", " (949, 0.0),\n", " (950, 0.03984095364447979),\n", " (951, 0.06804138174397717),\n", " (952, 0.025717224993681984),\n", " (953, 0.025416428388767443),\n", " (954, 0.0),\n", " (955, 0.02817180849095055),\n", " (956, 0.05407380704358751),\n", " (957, 0.034020690871988585),\n", " (958, 0.0),\n", " (959, 0.026352313834736494),\n", " (960, 0.09284766908852593),\n", " (961, 0.053376051268362375),\n", " (962, 0.025125945381480302),\n", " (963, 0.050251890762960605),\n", " (964, 0.029462782549439476),\n", " (965, 0.0),\n", " (966, 0.0),\n", " (967, 0.03928371006591931),\n", " (968, 0.0),\n", " (969, 0.044151078568834795),\n", " (970, 0.0),\n", " (971, 0.03333333333333333),\n", " (972, 0.2130032168075646),\n", " (973, 0.20008168266626025),\n", " (974, 0.025054867600094295),\n", " (975, 0.02450715406979359),\n", " (976, 0.03268602252303067),\n", " (977, 0.0),\n", " (978, 0.0),\n", " (979, 0.07715167498104596),\n", " (980, 0.09284766908852593),\n", " (981, 0.048112522432468816),\n", " (982, 0.044151078568834795),\n", " (983, 0.0),\n", " (984, 0.030949223029508643),\n", " (985, 0.016835875742536845),\n", " (986, 0.0),\n", " (987, 0.08111071056538127),\n", " (988, 0.10675210253672475),\n", " (989, 0.030429030972509225),\n", " (990, 0.0),\n", " (991, 0.034752402342845795),\n", " (992, 0.046676002800933654),\n", " (993, 0.03333333333333333),\n", " (994, 0.0),\n", " (995, 0.03928371006591931),\n", " (996, 0.057166195047502935),\n", " (997, 0.07372097807744857),\n", " (998, 0.0629940788348712),\n", " (999, 0.0),\n", " ...]" ] }, "execution_count": 55, "metadata": {}, "output_type": "execute_result" } ], "source": [ "list(enumerate(similarity[0]))\n" ] }, { "cell_type": "code", "execution_count": 56, "id": "867d5e21", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[(539, 0.25724787771376323),\n", " (1194, 0.2545875386086578),\n", " (260, 0.24759378423606915),\n", " (507, 0.2472066162365221),\n", " (1216, 0.24595492912420727)]" ] }, "execution_count": 56, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sorted(list(enumerate(similarity[0])),reverse=True,key=lambda x:x[1])[1:6]" ] }, { "cell_type": "code", "execution_count": 57, "id": "ff5dd0b2", "metadata": {}, "outputs": [], "source": [ "def recommend(movie):\n", " try:\n", " movie_index = new_df[new_df['title'].str.lower() == movie.lower()].index[0]\n", " except IndexError:\n", " return pd.DataFrame({\"Error\": [\"Movie not found\"]})\n", " \n", " distances = similarity[movie_index]\n", " movies_list = sorted(list(enumerate(distances)), reverse=True, key=lambda x: x[1])[1:6]\n", " \n", " recommended_movies = [{'Title': new_df.iloc[i[0]].title, 'Similarity': i[1]} for i in movies_list]\n", " recommended_df = pd.DataFrame(recommended_movies)\n", " return recommended_df" ] }, { "cell_type": "code", "execution_count": 58, "id": "a217ea6a", "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", "
TitleSimilarity
0Titan A.E.0.257248
1Small Soldiers0.254588
2Ender's Game0.247594
3Independence Day0.247207
4Aliens vs Predator: Requiem0.245955
\n", "
" ], "text/plain": [ " Title Similarity\n", "0 Titan A.E. 0.257248\n", "1 Small Soldiers 0.254588\n", "2 Ender's Game 0.247594\n", "3 Independence Day 0.247207\n", "4 Aliens vs Predator: Requiem 0.245955" ] }, "execution_count": 58, "metadata": {}, "output_type": "execute_result" } ], "source": [ "recommend('avatar')" ] }, { "cell_type": "code", "execution_count": 59, "id": "6004c669", "metadata": {}, "outputs": [], "source": [ "import gradio as gr" ] }, { "cell_type": "code", "execution_count": 60, "id": "be5a45fd", "metadata": { "scrolled": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Running on local URL: http://127.0.0.1:7869\n", "Running on public URL: https://85eb6f503252083fca.gradio.live\n", "\n", "This share link expires in 72 hours. For free permanent hosting and GPU upgrades, run `gradio deploy` from Terminal to deploy to Spaces (https://huggingface.co/spaces)\n" ] }, { "data": { "text/html": [ "
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [] }, "execution_count": 60, "metadata": {}, "output_type": "execute_result" } ], "source": [ "iface = gr.Interface(recommend, \n", " inputs=gr.Textbox(label=\"Enter a movie title\"), \n", " outputs=gr.DataFrame(label=\"Recommended movies\"))\n", "iface.launch()" ] }, { "cell_type": "code", "execution_count": 61, "id": "d46c3c74", "metadata": {}, "outputs": [], "source": [ "!pip freeze > requirements.txt\n", "\n" ] }, { "cell_type": "code", "execution_count": null, "id": "cb389c77", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "848d2dd6", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "3a9e7bc9", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "a427ecb7", "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" } }, "nbformat": 4, "nbformat_minor": 5 }