{ "cells": [ { "cell_type": "code", "execution_count": 50, "id": "714ff7ac", "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import pandas as pd" ] }, { "cell_type": "code", "execution_count": 51, "id": "1bb732cd", "metadata": {}, "outputs": [], "source": [ "movies = pd.read_csv(\"tmdb_5000_movies.csv\")\n", "credits = pd.read_csv('tmdb_5000_credits.csv')" ] }, { "cell_type": "code", "execution_count": 52, "id": "797513a7", "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": 52, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movies.head()" ] }, { "cell_type": "code", "execution_count": 53, "id": "f6834133", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array(['[{\"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\"}]'],\n", " dtype=object)" ] }, "execution_count": 53, "metadata": {}, "output_type": "execute_result" } ], "source": [ "credits.head(1).crew.values" ] }, { "cell_type": "code", "execution_count": 54, "id": "18ec431c", "metadata": {}, "outputs": [], "source": [ "movies = movies.merge(credits,on='title')" ] }, { "cell_type": "code", "execution_count": 55, "id": "7396d80a", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "Int64Index: 4809 entries, 0 to 4808\n", "Data columns (total 23 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 budget 4809 non-null int64 \n", " 1 genres 4809 non-null object \n", " 2 homepage 1713 non-null object \n", " 3 id 4809 non-null int64 \n", " 4 keywords 4809 non-null object \n", " 5 original_language 4809 non-null object \n", " 6 original_title 4809 non-null object \n", " 7 overview 4806 non-null object \n", " 8 popularity 4809 non-null float64\n", " 9 production_companies 4809 non-null object \n", " 10 production_countries 4809 non-null object \n", " 11 release_date 4808 non-null object \n", " 12 revenue 4809 non-null int64 \n", " 13 runtime 4807 non-null float64\n", " 14 spoken_languages 4809 non-null object \n", " 15 status 4809 non-null object \n", " 16 tagline 3965 non-null object \n", " 17 title 4809 non-null object \n", " 18 vote_average 4809 non-null float64\n", " 19 vote_count 4809 non-null int64 \n", " 20 movie_id 4809 non-null int64 \n", " 21 cast 4809 non-null object \n", " 22 crew 4809 non-null object \n", "dtypes: float64(3), int64(5), object(15)\n", "memory usage: 901.7+ KB\n" ] } ], "source": [ "movies.info()\n" ] }, { "cell_type": "code", "execution_count": 56, "id": "e8ada050", "metadata": {}, "outputs": [], "source": [ "#genre\n", "#id\n", "#keywords\n", "#title\n", "#overview\n", "#cast\n", "#crew\n", "\n", "movies = movies[['movie_id','title','overview','genres','keywords','cast','crew']]" ] }, { "cell_type": "code", "execution_count": 57, "id": "7d39cf98", "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": 57, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movies.head()" ] }, { "cell_type": "code", "execution_count": 58, "id": "ed53c612", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "movie_id 0\n", "title 0\n", "overview 0\n", "genres 0\n", "keywords 0\n", "cast 0\n", "crew 0\n", "dtype: int64" ] }, "execution_count": 58, "metadata": {}, "output_type": "execute_result" } ], "source": [ "#Checking missing data and removing \n", "\n", "\n", "movies.dropna(inplace=True)\n", "movies.isna().sum()\n" ] }, { "cell_type": "code", "execution_count": 59, "id": "ced5a97d", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "movie_id 0\n", "title 0\n", "overview 0\n", "genres 0\n", "keywords 0\n", "cast 0\n", "crew 0\n", "dtype: int64" ] }, "execution_count": 59, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movies.isna().sum()\n" ] }, { "cell_type": "code", "execution_count": 60, "id": "4ad8d5d1", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0" ] }, "execution_count": 60, "metadata": {}, "output_type": "execute_result" } ], "source": [ "#Checking Duplicate Data\n", "\n", "movies.duplicated().sum()" ] }, { "cell_type": "code", "execution_count": 61, "id": "9c737e7b", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'[{\"id\": 28, \"name\": \"Action\"}, {\"id\": 12, \"name\": \"Adventure\"}, {\"id\": 14, \"name\": \"Fantasy\"}, {\"id\": 878, \"name\": \"Science Fiction\"}]'" ] }, "execution_count": 61, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movies.iloc[0].genres" ] }, { "cell_type": "code", "execution_count": 62, "id": "137815e6", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['Action', 'Adventure', 'Fantasy', 'Science Fiction']" ] }, "execution_count": 62, "metadata": {}, "output_type": "execute_result" } ], "source": [ "'[{\"id\": 28, \"name\": \"Action\"}, {\"id\": 12, \"name\": \"Adventure\"}, {\"id\": 14, \"name\": \"Fantasy\"}, {\"id\": 878, \"name\": \"Science Fiction\"}]'\n", "\n", "\n", "['Action','Adventure','Fantasy','Science Fiction']" ] }, { "cell_type": "code", "execution_count": 63, "id": "09fc40c9", "metadata": {}, "outputs": [], "source": [ "# Creating a function to remove this genres\n", "\n", "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": 64, "id": "c29d61d1", "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": 64, "metadata": {}, "output_type": "execute_result" } ], "source": [ "#Converting strings data to list\n", "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": 65, "id": "c628f90d", "metadata": {}, "outputs": [], "source": [ "movies['genres'] = movies['genres'].apply(convert)" ] }, { "cell_type": "code", "execution_count": 66, "id": "34002575", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "Int64Index: 4806 entries, 0 to 4808\n", "Data columns (total 7 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 movie_id 4806 non-null int64 \n", " 1 title 4806 non-null object\n", " 2 overview 4806 non-null object\n", " 3 genres 4806 non-null object\n", " 4 keywords 4806 non-null object\n", " 5 cast 4806 non-null object\n", " 6 crew 4806 non-null object\n", "dtypes: int64(1), object(6)\n", "memory usage: 300.4+ KB\n" ] } ], "source": [ "movies.info()" ] }, { "cell_type": "code", "execution_count": 67, "id": "90b7dd75", "metadata": {}, "outputs": [], "source": [ "movies['keywords'] = movies['keywords'].apply(convert)" ] }, { "cell_type": "code", "execution_count": 68, "id": "586c251d", "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": 68, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movies.head()" ] }, { "cell_type": "code", "execution_count": 69, "id": "afc895ab", "metadata": {}, "outputs": [], "source": [ "def convert3(obj):\n", " L = []\n", " counter = 0\n", " for i in ast.literal_eval(obj):\n", " if counter < 4:\n", " L.append(i['name'])\n", " counter= counter +1\n", " return L" ] }, { "cell_type": "code", "execution_count": 70, "id": "17923edd", "metadata": {}, "outputs": [], "source": [ "movies['cast'] = movies['cast'].apply(convert3)" ] }, { "cell_type": "code", "execution_count": 71, "id": "924744a4", "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", "
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 Weave...[{\"credit_id\": \"52fe48009251416c750aca23\", \"de...
\n", "
" ], "text/plain": [ " movie_id title overview \\\n", "0 19995 Avatar In the 22nd century, a paraplegic Marine is di... \n", "\n", " genres \\\n", "0 [Action, Adventure, Fantasy, Science Fiction] \n", "\n", " keywords \\\n", "0 [culture clash, future, space war, space colon... \n", "\n", " cast \\\n", "0 [Sam Worthington, Zoe Saldana, Sigourney Weave... \n", "\n", " crew \n", "0 [{\"credit_id\": \"52fe48009251416c750aca23\", \"de... " ] }, "execution_count": 71, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movies.head(1)" ] }, { "cell_type": "code", "execution_count": 72, "id": "c6eace56", "metadata": {}, "outputs": [], "source": [ "def fetchDirector(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": 73, "id": "0c1419e2", "metadata": {}, "outputs": [], "source": [ "movies['crew'] = movies['crew'].apply(fetchDirector)" ] }, { "cell_type": "code", "execution_count": 74, "id": "1677cad6", "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", "
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 Weave...[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, R...[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, A...[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]
5559Spider-Man 3The seemingly invincible Spider-Man goes up ag...[Fantasy, Action, Adventure][dual identity, amnesia, sandstorm, love of on...[Tobey Maguire, Kirsten Dunst, James Franco, T...[Sam Raimi]
638757TangledWhen the kingdom's most wanted-and most charmi...[Animation, Family][hostage, magic, horse, fairy tale, musical, p...[Zachary Levi, Mandy Moore, Donna Murphy, Ron ...[Byron Howard]
799861Avengers: Age of UltronWhen Tony Stark tries to jumpstart a dormant p...[Action, Adventure, Science Fiction][marvel comic, sequel, superhero, based on com...[Robert Downey Jr., Chris Hemsworth, Mark Ruff...[Joss Whedon]
8767Harry Potter and the Half-Blood PrinceAs Harry begins his sixth year at Hogwarts, he...[Adventure, Fantasy, Family][witch, magic, broom, school of witchcraft, wi...[Daniel Radcliffe, Rupert Grint, Emma Watson, ...[David Yates]
9209112Batman v Superman: Dawn of JusticeFearing the actions of a god-like Super Hero l...[Action, Adventure, Fantasy][dc comics, vigilante, superhero, based on com...[Ben Affleck, Henry Cavill, Gal Gadot, Amy Adams][Zack Snyder]
\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", "5 559 Spider-Man 3 \n", "6 38757 Tangled \n", "7 99861 Avengers: Age of Ultron \n", "8 767 Harry Potter and the Half-Blood Prince \n", "9 209112 Batman v Superman: Dawn of Justice \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", "5 The seemingly invincible Spider-Man goes up ag... \n", "6 When the kingdom's most wanted-and most charmi... \n", "7 When Tony Stark tries to jumpstart a dormant p... \n", "8 As Harry begins his sixth year at Hogwarts, he... \n", "9 Fearing the actions of a god-like Super Hero l... \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", "5 [Fantasy, Action, Adventure] \n", "6 [Animation, Family] \n", "7 [Action, Adventure, Science Fiction] \n", "8 [Adventure, Fantasy, Family] \n", "9 [Action, Adventure, Fantasy] \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", "5 [dual identity, amnesia, sandstorm, love of on... \n", "6 [hostage, magic, horse, fairy tale, musical, p... \n", "7 [marvel comic, sequel, superhero, based on com... \n", "8 [witch, magic, broom, school of witchcraft, wi... \n", "9 [dc comics, vigilante, superhero, based on com... \n", "\n", " cast crew \n", "0 [Sam Worthington, Zoe Saldana, Sigourney Weave... [James Cameron] \n", "1 [Johnny Depp, Orlando Bloom, Keira Knightley, ... [Gore Verbinski] \n", "2 [Daniel Craig, Christoph Waltz, Léa Seydoux, R... [Sam Mendes] \n", "3 [Christian Bale, Michael Caine, Gary Oldman, A... [Christopher Nolan] \n", "4 [Taylor Kitsch, Lynn Collins, Samantha Morton,... [Andrew Stanton] \n", "5 [Tobey Maguire, Kirsten Dunst, James Franco, T... [Sam Raimi] \n", "6 [Zachary Levi, Mandy Moore, Donna Murphy, Ron ... [Byron Howard] \n", "7 [Robert Downey Jr., Chris Hemsworth, Mark Ruff... [Joss Whedon] \n", "8 [Daniel Radcliffe, Rupert Grint, Emma Watson, ... [David Yates] \n", "9 [Ben Affleck, Henry Cavill, Gal Gadot, Amy Adams] [Zack Snyder] " ] }, "execution_count": 74, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movies.head(10)" ] }, { "cell_type": "code", "execution_count": 75, "id": "ca044812", "metadata": {}, "outputs": [], "source": [ "#converting string to lists\n", "movies['overview'] = movies['overview'].apply(lambda x:x.split())" ] }, { "cell_type": "code", "execution_count": 76, "id": "bb016d7f", "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 Weave...[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, R...[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, A...[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 Weave... [James Cameron] \n", "1 [Johnny Depp, Orlando Bloom, Keira Knightley, ... [Gore Verbinski] \n", "2 [Daniel Craig, Christoph Waltz, Léa Seydoux, R... [Sam Mendes] \n", "3 [Christian Bale, Michael Caine, Gary Oldman, A... [Christopher Nolan] \n", "4 [Taylor Kitsch, Lynn Collins, Samantha Morton,... [Andrew Stanton] " ] }, "execution_count": 76, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movies.head()" ] }, { "cell_type": "code", "execution_count": 77, "id": "47271426", "metadata": {}, "outputs": [], "source": [ "#Removing spaces from all coulmns\n", "\n", "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": 78, "id": "3c4f5e54", "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, Ste...[GoreVerbinski]
2206647Spectre[A, cryptic, message, from, Bond’s, past, send...[Action, Adventure, Crime][spy, basedonnovel, secretagent, sequel, mi6, ...[DanielCraig, ChristophWaltz, LéaSeydoux, Ralp...[SamMendes]
349026The Dark Knight Rises[Following, the, death, of, District, Attorney...[Action, Crime, Drama, Thriller][dccomics, crimefighter, terrorist, secretiden...[ChristianBale, MichaelCaine, GaryOldman, Anne...[ChristopherNolan]
449529John Carter[John, Carter, is, a, war-weary,, former, mili...[Action, Adventure, ScienceFiction][basedonnovel, mars, medallion, spacetravel, p...[TaylorKitsch, LynnCollins, SamanthaMorton, Wi...[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, Ste... [GoreVerbinski] \n", "2 [DanielCraig, ChristophWaltz, LéaSeydoux, Ralp... [SamMendes] \n", "3 [ChristianBale, MichaelCaine, GaryOldman, Anne... [ChristopherNolan] \n", "4 [TaylorKitsch, LynnCollins, SamanthaMorton, Wi... [AndrewStanton] " ] }, "execution_count": 78, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movies.head()" ] }, { "cell_type": "code", "execution_count": 79, "id": "143f5fed", "metadata": {}, "outputs": [], "source": [ "movies['tags'] = movies['overview'] + movies['genres'] + movies['keywords'] + movies['cast'] + movies['crew']" ] }, { "cell_type": "code", "execution_count": 80, "id": "280df00c", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0 [In, the, 22nd, century,, a, paraplegic, Marin...\n", "Name: tags, dtype: object" ] }, "execution_count": 80, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movies['tags'].head(1)" ] }, { "cell_type": "code", "execution_count": 81, "id": "bf4b8e4f", "metadata": {}, "outputs": [], "source": [ "new_df = movies[['movie_id','title','tags']]" ] }, { "cell_type": "code", "execution_count": 82, "id": "f121e31e", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "C:\\Users\\Jarvis\\AppData\\Local\\Temp\\ipykernel_4016\\1748576972.py:3: 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": [ "#converting list into string\n", "\n", "new_df['tags'] = new_df['tags'].apply(lambda x:\" \".join(x))" ] }, { "cell_type": "code", "execution_count": 83, "id": "2c4ce0f2", "metadata": { "scrolled": true }, "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 StephenLang JamesCameron'" ] }, "execution_count": 83, "metadata": {}, "output_type": "execute_result" } ], "source": [ "new_df['tags'][0]" ] }, { "cell_type": "code", "execution_count": 84, "id": "1a838eb3", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "C:\\Users\\Jarvis\\AppData\\Local\\Temp\\ipykernel_4016\\1165753669.py:3: 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": [ "# Converting upper case letters to lower\n", "\n", "new_df['tags'] = new_df['tags'].apply(lambda x:x.lower())" ] }, { "cell_type": "code", "execution_count": 85, "id": "de3d2623", "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": 85, "metadata": {}, "output_type": "execute_result" } ], "source": [ "new_df.head()" ] }, { "cell_type": "code", "execution_count": 86, "id": "09f43ea9", "metadata": {}, "outputs": [], "source": [ "from nltk.stem.porter import PorterStemmer" ] }, { "cell_type": "code", "execution_count": 87, "id": "2e2d623e", "metadata": {}, "outputs": [], "source": [ "ps = PorterStemmer()" ] }, { "cell_type": "code", "execution_count": 88, "id": "6e94583f", "metadata": {}, "outputs": [], "source": [ "# stemming is a tool to convert long words into short like loved to love\n", "def stem(text):\n", " y = []\n", " \n", " for i in text.split():\n", " y.append(ps.stem(i))\n", " return \" \".join(y)" ] }, { "cell_type": "code", "execution_count": 89, "id": "3fdba0c0", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'in the 22nd century, a parapleg marin is dispatch to the moon pandora on a uniqu mission, but becom torn between follow order and protect an alien civilization. action adventur fantasi sciencefict cultureclash futur spacewar spacecoloni societi spacetravel futurist romanc space alien tribe alienplanet cgi marin soldier battl loveaffair antiwar powerrel mindandsoul 3d samworthington zoesaldana sigourneyweav stephenlang jamescameron'" ] }, "execution_count": 89, "metadata": {}, "output_type": "execute_result" } ], "source": [ "stem('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 StephenLang JamesCameron')" ] }, { "cell_type": "code", "execution_count": 90, "id": "f0032650", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "C:\\Users\\Jarvis\\AppData\\Local\\Temp\\ipykernel_4016\\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": 91, "id": "2cd4b044", "metadata": {}, "outputs": [], "source": [ "#converting strings into words using vector method\n", "\n", "\n", "from sklearn.feature_extraction.text import CountVectorizer\n", "cv = CountVectorizer(max_features=5000,stop_words='english')" ] }, { "cell_type": "code", "execution_count": 92, "id": "8897eeba", "metadata": {}, "outputs": [], "source": [ "vectors = cv.fit_transform(new_df['tags']).toarray()" ] }, { "cell_type": "code", "execution_count": 93, "id": "be7845d1", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([0, 0, 0, ..., 0, 0, 0], dtype=int64)" ] }, "execution_count": 93, "metadata": {}, "output_type": "execute_result" } ], "source": [ "vectors[0]" ] }, { "cell_type": "code", "execution_count": 94, "id": "310e5c21", "metadata": {}, "outputs": [], "source": [ "# Measure cosine distance of all movies \n", "\n", "from sklearn.metrics.pairwise import cosine_similarity\n", "similarity = cosine_similarity(vectors)" ] }, { "cell_type": "code", "execution_count": 95, "id": "29f6b258", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "4806" ] }, "execution_count": 95, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(similarity[0])" ] }, { "cell_type": "code", "execution_count": 96, "id": "7e3253b2", "metadata": {}, "outputs": [], "source": [ "## Recommentation \n", "\n", "def recommend(movie):\n", " movies_list = new_df[new_df['title'] == movie].index[0]\n", " distances =sorted(list(enumerate(similarity[movies_list])),reverse=True,key= lambda x:x[1])\n", " for i in distances[1:6]:\n", " print(new_df.iloc[i[0]].title)\n", " " ] }, { "cell_type": "code", "execution_count": 97, "id": "ef083368", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[(0, 1.0000000000000004),\n", " (1216, 0.28676966733820225),\n", " (2409, 0.26310068027921696),\n", " (507, 0.255608593705383),\n", " (3730, 0.25391668753850405),\n", " (539, 0.2467838236981868),\n", " (582, 0.24511108480187255),\n", " (1204, 0.23918243661746996),\n", " (1194, 0.2367785320221084),\n", " (61, 0.23179316248638276),\n", " (778, 0.2294157338705618),\n", " (1920, 0.2252817784447915),\n", " (4048, 0.22329687826943603),\n", " (2786, 0.22269966704152225),\n", " (172, 0.21239769762143662),\n", " (972, 0.2073221072156823),\n", " (2971, 0.20602141085758227),\n", " (322, 0.20519567041703082),\n", " (2333, 0.20443988269091456),\n", " (3608, 0.20437977982832192),\n", " (4192, 0.2029530274475215),\n", " (1444, 0.20277677641345318),\n", " (1089, 0.2020475485519274),\n", " (260, 0.20073876713674155),\n", " (74, 0.20054543301971392),\n", " (151, 0.19867985355975665),\n", " (3675, 0.1979082783981174),\n", " (973, 0.19767387315371682),\n", " (577, 0.1976738731537168),\n", " (47, 0.19529164171612676),\n", " (3327, 0.19117977822546817),\n", " (1201, 0.19088542889273336),\n", " (942, 0.1892994097121204),\n", " (27, 0.18848425873126295),\n", " (305, 0.18848425873126295),\n", " (4, 0.18731716231633883),\n", " (495, 0.18731716231633883),\n", " (4405, 0.18731716231633883),\n", " (1329, 0.18394180184548975),\n", " (1071, 0.18183351671314588),\n", " (2999, 0.1813690625275029),\n", " (94, 0.18074256993863339),\n", " (3999, 0.18074256993863339),\n", " (83, 0.17996850826633903),\n", " (1321, 0.17699808135119718),\n", " (168, 0.17521916101261562),\n", " (184, 0.17521916101261562),\n", " (2204, 0.17521916101261562),\n", " (4336, 0.17521916101261562),\n", " (220, 0.1748149640244195),\n", " (1275, 0.1748149640244195),\n", " (300, 0.17316974359835272),\n", " (3538, 0.1711905958155815),\n", " (3162, 0.17040572913692198),\n", " (931, 0.16943474841747155),\n", " (36, 0.1692777916923361),\n", " (373, 0.1691275228729346),\n", " (529, 0.16742770563222897),\n", " (1831, 0.16742770563222897),\n", " (1982, 0.16692446522239718),\n", " (150, 0.16531163063339513),\n", " (661, 0.16481712868606585),\n", " (91, 0.16452254913212452),\n", " (41, 0.16390251702679648),\n", " (595, 0.16390251702679648),\n", " (1537, 0.16222142113076254),\n", " (67, 0.16222142113076252),\n", " (342, 0.1602550282040466),\n", " (1178, 0.1600142241187995),\n", " (2515, 0.15907119074394446),\n", " (4010, 0.15737789507292674),\n", " (31, 0.15609763526361567),\n", " (2731, 0.15609763526361567),\n", " (513, 0.15585730003983933),\n", " (149, 0.1540171257313038),\n", " (26, 0.15389675281277312),\n", " (1344, 0.152008377581442),\n", " (187, 0.15200837758144198),\n", " (838, 0.1518926498314485),\n", " (111, 0.14843120879858804),\n", " (311, 0.14843120879858804),\n", " (1383, 0.14843120879858804),\n", " (581, 0.14808721943977307),\n", " (2075, 0.14808721943977307),\n", " (2760, 0.1478360110834291),\n", " (3354, 0.14567913668701626),\n", " (7, 0.14509525002200235),\n", " (52, 0.14509525002200235),\n", " (108, 0.14509525002200235),\n", " (127, 0.14509525002200235),\n", " (1297, 0.14509525002200235),\n", " (466, 0.14509525002200233),\n", " (1396, 0.14421498760030763),\n", " (1056, 0.14350946197048198),\n", " (1355, 0.14350946197048198),\n", " (1938, 0.14350946197048198),\n", " (275, 0.1433848336691011),\n", " (413, 0.1433848336691011),\n", " (579, 0.1433848336691011),\n", " (1479, 0.14306584587982532),\n", " (490, 0.14159846508095775),\n", " (294, 0.1411956236812263),\n", " (461, 0.1411956236812263),\n", " (568, 0.1411956236812263),\n", " (95, 0.14048787173725413),\n", " (1273, 0.14048787173725413),\n", " (17, 0.13977653617040256),\n", " (2496, 0.1391037210186643),\n", " (3409, 0.1391037210186643),\n", " (249, 0.13834289277321493),\n", " (1327, 0.13834289277321493),\n", " (1488, 0.13834289277321493),\n", " (3781, 0.13834289277321493),\n", " (1965, 0.1377056581888109),\n", " (46, 0.13710212427677043),\n", " (859, 0.13710212427677043),\n", " (2169, 0.13710212427677043),\n", " (4538, 0.13629325512727639),\n", " (56, 0.13530201829834768),\n", " (505, 0.13530201829834768),\n", " (2584, 0.13530201829834768),\n", " (3982, 0.13530201829834768),\n", " (72, 0.13518451760896877),\n", " (843, 0.13518451760896877),\n", " (937, 0.13518451760896877),\n", " (4348, 0.13497638119975428),\n", " (1322, 0.13476498501489081),\n", " (777, 0.13369695534647594),\n", " (1560, 0.13334518676566626),\n", " (1808, 0.13334518676566626),\n", " (668, 0.1324532357065044),\n", " (935, 0.1324532357065044),\n", " (158, 0.13245323570650439),\n", " (502, 0.13245323570650439),\n", " (126, 0.13157894736842107),\n", " (1015, 0.13157894736842107),\n", " (4079, 0.13157894736842107),\n", " (2133, 0.13124359177794215),\n", " (3622, 0.12988108336653278),\n", " (368, 0.12977713690461004),\n", " (476, 0.12977713690461004),\n", " (1373, 0.12977713690461004),\n", " (2378, 0.12977713690461004),\n", " (2873, 0.12892051277806202),\n", " (14, 0.12824729401064427),\n", " (138, 0.12824729401064427),\n", " (1086, 0.12824729401064427),\n", " (2181, 0.12824729401064427),\n", " (2686, 0.12824729401064427),\n", " (4230, 0.12824729401064427),\n", " (134, 0.12725695259515557),\n", " (487, 0.12725695259515557),\n", " (773, 0.12725695259515557),\n", " (1774, 0.12725695259515557),\n", " (1833, 0.12725695259515557),\n", " (2970, 0.12725695259515557),\n", " (369, 0.126673647984535),\n", " (557, 0.12515654358043973),\n", " (754, 0.12515654358043973),\n", " (2450, 0.12515654358043973),\n", " (3628, 0.12515654358043973),\n", " (1158, 0.12487810821089254),\n", " (1741, 0.12462194771917919),\n", " (166, 0.12369267399882337),\n", " (84, 0.12361284651454937),\n", " (208, 0.12262786789699316),\n", " (483, 0.12262786789699316),\n", " (1096, 0.12262786789699316),\n", " (2652, 0.12262786789699316),\n", " (102, 0.12262786789699313),\n", " (1878, 0.12262786789699313),\n", " (1299, 0.12227899701112964),\n", " (2331, 0.12166606584807191),\n", " (2480, 0.12166606584807191),\n", " (2674, 0.12166606584807191),\n", " (3083, 0.12166606584807191),\n", " (438, 0.12091270835166862),\n", " (3235, 0.12091270835166862),\n", " (68, 0.1204950466257556),\n", " (1658, 0.1204950466257556),\n", " (2060, 0.1204950466257556),\n", " (139, 0.11980845957463077),\n", " (1002, 0.11980845957463077),\n", " (549, 0.11959121830873498),\n", " (870, 0.11959121830873498),\n", " (781, 0.11846977555181847),\n", " (1004, 0.11846977555181847),\n", " (1047, 0.11846977555181847),\n", " (1274, 0.11846977555181847),\n", " (2741, 0.11846977555181847),\n", " (3376, 0.11846977555181847),\n", " (4673, 0.11846977555181847),\n", " (900, 0.11831213107007527),\n", " (1673, 0.11803342130469505),\n", " (1715, 0.11803342130469505),\n", " (2789, 0.11803342130469505),\n", " (4000, 0.11803342130469505),\n", " (182, 0.11707322644771176),\n", " (2284, 0.11707322644771176),\n", " (678, 0.116543309349613),\n", " (160, 0.11650496642725611),\n", " (589, 0.1163350101494222),\n", " (278, 0.11587244366483038),\n", " (454, 0.11587244366483038),\n", " (1617, 0.11587244366483038),\n", " (1497, 0.11551284429847784),\n", " (3212, 0.11542256460957984),\n", " (1220, 0.1147078669352809),\n", " (2547, 0.1147078669352809),\n", " (432, 0.11470786693528089),\n", " (85, 0.11470786693528087),\n", " (122, 0.11470786693528087),\n", " (236, 0.11470786693528087),\n", " (1301, 0.11470786693528087),\n", " (1418, 0.11357771260606365),\n", " (238, 0.11314714296070713),\n", " (3147, 0.11314714296070713),\n", " (889, 0.11299144295167773),\n", " (422, 0.11295649894498103),\n", " (536, 0.1124803176664619),\n", " (189, 0.11164843913471803),\n", " (627, 0.11164843913471803),\n", " (808, 0.11164843913471803),\n", " (1348, 0.11164843913471803),\n", " (3721, 0.11164843913471803),\n", " (123, 0.11141412945539662),\n", " (420, 0.11141412945539662),\n", " (2372, 0.11141412945539662),\n", " (1512, 0.11141412945539661),\n", " (50, 0.11128297681493143),\n", " (87, 0.11128297681493143),\n", " (232, 0.11128297681493143),\n", " (1616, 0.11128297681493143),\n", " (4468, 0.11128297681493143),\n", " (206, 0.11092107999698035),\n", " (228, 0.11037769642208699),\n", " (229, 0.11020775375559674),\n", " (28, 0.10968169942141635),\n", " (121, 0.10968169942141635),\n", " (449, 0.10968169942141635),\n", " (1031, 0.10968169942141635),\n", " (2817, 0.10968169942141635),\n", " (3008, 0.10968169942141635),\n", " (81, 0.1095080149111477),\n", " (1574, 0.1095080149111477),\n", " (3630, 0.10936965981495178),\n", " (256, 0.10882143751650175),\n", " (653, 0.10882143751650175),\n", " (1524, 0.10882143751650175),\n", " (692, 0.10838874619051501),\n", " (3093, 0.10838874619051501),\n", " (3309, 0.10838874619051501),\n", " (307, 0.10827043935570556),\n", " (332, 0.10814761408717502),\n", " (472, 0.10814761408717502),\n", " (786, 0.10814761408717502),\n", " (1237, 0.10814761408717502),\n", " (1945, 0.10814761408717502),\n", " (3140, 0.10814761408717502),\n", " (3428, 0.10814761408717502),\n", " (3498, 0.10814761408717502),\n", " (4777, 0.10814761408717502),\n", " (5, 0.10743376064838502),\n", " (740, 0.10743376064838502),\n", " (939, 0.1068366854693644),\n", " (21, 0.106676149412533),\n", " (262, 0.10650358071057624),\n", " (572, 0.10650358071057624),\n", " (233, 0.10619884881071831),\n", " (1575, 0.10619884881071831),\n", " (2161, 0.10619884881071831),\n", " (2521, 0.10619884881071831),\n", " (2634, 0.10619884881071831),\n", " (467, 0.10559715077387793),\n", " (1496, 0.10559715077387793),\n", " (295, 0.10526315789473685),\n", " (687, 0.10526315789473685),\n", " (814, 0.10526315789473685),\n", " (2072, 0.10526315789473685),\n", " (3340, 0.10526315789473685),\n", " (170, 0.10471347707292386),\n", " (2498, 0.10471347707292386),\n", " (75, 0.10390486669322622),\n", " (131, 0.10390486669322622),\n", " (223, 0.10390486669322622),\n", " (3152, 0.10390486669322622),\n", " (541, 0.103851623099316),\n", " (2439, 0.10385162309931599),\n", " (200, 0.1037571695799112),\n", " (1166, 0.1037571695799112),\n", " (1501, 0.1037571695799112),\n", " (1745, 0.1037571695799112),\n", " (3621, 0.1037571695799112),\n", " (3839, 0.1037571695799112),\n", " (4135, 0.1037571695799112),\n", " (654, 0.10301070542879115),\n", " (1455, 0.10301070542879115),\n", " (312, 0.10259783520851541),\n", " (508, 0.10259783520851541),\n", " (1082, 0.10259783520851541),\n", " (2148, 0.10259783520851541),\n", " (3634, 0.10259783520851541),\n", " (3755, 0.10259783520851541),\n", " (3874, 0.10259783520851541),\n", " (4097, 0.10259783520851541),\n", " (2106, 0.10218988991416095),\n", " (105, 0.10147651372376076),\n", " (624, 0.10147651372376076),\n", " (2323, 0.10147651372376076),\n", " (2456, 0.10147651372376076),\n", " (2762, 0.10147651372376076),\n", " (3055, 0.10147651372376076),\n", " (3663, 0.10147651372376076),\n", " (4198, 0.10147651372376076),\n", " (3441, 0.10138838820672659),\n", " (10, 0.101338918387628),\n", " (1037, 0.101338918387628),\n", " (1195, 0.101338918387628),\n", " (1294, 0.101338918387628),\n", " (1771, 0.101338918387628),\n", " (2247, 0.10133891838762799),\n", " (2099, 0.10060545457319173),\n", " (1614, 0.10012523486435178),\n", " (1405, 0.09984038297885897),\n", " (1439, 0.09984038297885897),\n", " (148, 0.09933992677987831),\n", " (157, 0.09933992677987831),\n", " (263, 0.09933992677987831),\n", " (325, 0.09933992677987831),\n", " (878, 0.09933992677987831),\n", " (1077, 0.09933992677987831),\n", " (1156, 0.09933992677987831),\n", " (1280, 0.09933992677987831),\n", " (1727, 0.09933992677987831),\n", " (1884, 0.09933992677987831),\n", " (4018, 0.09933992677987831),\n", " (4490, 0.09933992677987831),\n", " (363, 0.09909250441117726),\n", " (491, 0.09909250441117726),\n", " (330, 0.0989541391990587),\n", " (445, 0.0989541391990587),\n", " (510, 0.0989541391990587),\n", " (643, 0.0989541391990587),\n", " (988, 0.0989541391990587),\n", " (1823, 0.0989541391990587),\n", " (3620, 0.0989541391990587),\n", " (3783, 0.0989541391990587),\n", " (3935, 0.0989541391990587),\n", " (1775, 0.09836118442057921),\n", " (266, 0.0978231976089037),\n", " (535, 0.0978231976089037),\n", " (898, 0.0978231976089037),\n", " (1109, 0.0978231976089037),\n", " (1401, 0.0978231976089037),\n", " (2253, 0.0978231976089037),\n", " (230, 0.09764582085806336),\n", " (35, 0.09733285267845754),\n", " (319, 0.09733285267845754),\n", " (715, 0.09733285267845754),\n", " (1306, 0.09733285267845754),\n", " (1942, 0.09733285267845754),\n", " (2053, 0.09733285267845754),\n", " (2787, 0.09733285267845754),\n", " (3954, 0.09733285267845754),\n", " (4203, 0.09733285267845754),\n", " (4472, 0.09733285267845754),\n", " (9, 0.0967301666813349),\n", " (334, 0.0967301666813349),\n", " (410, 0.0967301666813349),\n", " (480, 0.0967301666813349),\n", " (2556, 0.0967301666813349),\n", " (371, 0.09567297464698798),\n", " (2241, 0.09567297464698798),\n", " (18, 0.09558988911273408),\n", " (4545, 0.09558988911273408),\n", " (33, 0.09544271444636668),\n", " (362, 0.09544271444636668),\n", " (791, 0.09544271444636668),\n", " (2562, 0.09544271444636668),\n", " (4256, 0.09544271444636668),\n", " (4403, 0.09544271444636668),\n", " (11, 0.09365858115816941),\n", " (244, 0.09365858115816941),\n", " (412, 0.09365858115816941),\n", " (587, 0.09365858115816941),\n", " (660, 0.09365858115816941),\n", " (920, 0.09365858115816941),\n", " (1276, 0.09365858115816941),\n", " (1357, 0.09365858115816941),\n", " (1474, 0.09365858115816941),\n", " (1573, 0.09365858115816941),\n", " (1686, 0.09365858115816941),\n", " (1692, 0.09365858115816941),\n", " (1721, 0.09365858115816941),\n", " (2488, 0.09365858115816941),\n", " (2592, 0.09365858115816941),\n", " (2645, 0.09365858115816941),\n", " (2650, 0.09365858115816941),\n", " (3407, 0.09365858115816941),\n", " (3537, 0.09365858115816941),\n", " (3720, 0.09365858115816941),\n", " (3736, 0.09365858115816941),\n", " (4331, 0.09365858115816941),\n", " (301, 0.09304036594559836),\n", " (129, 0.09269795493186431),\n", " (243, 0.09269795493186431),\n", " (279, 0.09269795493186431),\n", " (596, 0.09269795493186431),\n", " (1446, 0.09269795493186431),\n", " (1701, 0.09269795493186431),\n", " (2820, 0.09269795493186431),\n", " (785, 0.09243423333081695),\n", " (980, 0.09197090092274487),\n", " (2093, 0.09197090092274487),\n", " (2396, 0.09197090092274487),\n", " (2651, 0.09197090092274487),\n", " (239, 0.09183979479633063),\n", " (799, 0.09183979479633063),\n", " (2570, 0.09183979479633061),\n", " (473, 0.09176629354822471),\n", " (813, 0.09176629354822471),\n", " (43, 0.09086217008485092),\n", " (331, 0.09086217008485092),\n", " (602, 0.09086217008485092),\n", " (997, 0.09086217008485092),\n", " (1233, 0.09086217008485092),\n", " (1846, 0.09086217008485092),\n", " (3881, 0.09086217008485092),\n", " (219, 0.09037128496931669),\n", " (511, 0.09037128496931669),\n", " (1027, 0.09037128496931669),\n", " (1756, 0.09037128496931669),\n", " (2251, 0.09037128496931669),\n", " (2868, 0.09037128496931669),\n", " (2957, 0.09037128496931669),\n", " (3448, 0.09037128496931669),\n", " (2796, 0.08998425413316952),\n", " (2856, 0.08998425413316952),\n", " (3389, 0.08998425413316952),\n", " (3443, 0.08998425413316952),\n", " (3462, 0.08998425413316952),\n", " (4343, 0.08998425413316952),\n", " (4353, 0.08998425413316952),\n", " (274, 0.08977310580745099),\n", " (1783, 0.0891313035643173),\n", " (1906, 0.0891313035643173),\n", " (2363, 0.0891313035643173),\n", " (3553, 0.0891313035643173),\n", " (2115, 0.08903057122447033),\n", " (12, 0.08885233166386385),\n", " (88, 0.08885233166386385),\n", " (356, 0.08885233166386385),\n", " (400, 0.08885233166386385),\n", " (794, 0.08885233166386385),\n", " (1480, 0.08885233166386385),\n", " (2660, 0.08885233166386385),\n", " (3322, 0.08885233166386385),\n", " (479, 0.08849904067559859),\n", " (169, 0.08830215713766959),\n", " (2713, 0.08830215713766959),\n", " (143, 0.08749572785196143),\n", " (199, 0.08749572785196143),\n", " (270, 0.08749572785196143),\n", " (2109, 0.08749572785196143),\n", " (2740, 0.08749572785196143),\n", " (167, 0.08740748201220976),\n", " (292, 0.08740748201220976),\n", " (389, 0.08740748201220976),\n", " (564, 0.08740748201220976),\n", " (1249, 0.08740748201220976),\n", " (1259, 0.08740748201220976),\n", " (2448, 0.08695980950674562),\n", " (618, 0.08671099695241201),\n", " (752, 0.08671099695241201),\n", " (827, 0.08671099695241201),\n", " (1832, 0.08671099695241201),\n", " (2880, 0.08671099695241201),\n", " (3556, 0.08671099695241201),\n", " (4502, 0.08671099695241201),\n", " (4516, 0.08671099695241201),\n", " (4587, 0.08671099695241201),\n", " (2, 0.08603090020146065),\n", " (23, 0.08603090020146065),\n", " (141, 0.08603090020146065),\n", " (457, 0.08603090020146065),\n", " (745, 0.08603090020146065),\n", " (775, 0.08603090020146065),\n", " (960, 0.08603090020146065),\n", " (3135, 0.08603090020146065),\n", " (3449, 0.08603090020146065),\n", " (4754, 0.08603090020146065),\n", " (217, 0.08594700851870801),\n", " (234, 0.08594700851870801),\n", " (1019, 0.08594700851870801),\n", " (2354, 0.08594700851870801),\n", " (1639, 0.08520286456846099),\n", " (142, 0.08471737420873576),\n", " (1378, 0.08471737420873576),\n", " (2583, 0.08471737420873576),\n", " (4560, 0.08471737420873576),\n", " (32, 0.08447772061910234),\n", " (1305, 0.08447772061910234),\n", " (19, 0.0837707816583391),\n", " (190, 0.0837707816583391),\n", " (534, 0.0837707816583391),\n", " (1530, 0.0837707816583391),\n", " (2968, 0.0837707816583391),\n", " (3218, 0.0837707816583391),\n", " (3905, 0.0837707816583391),\n", " (3978, 0.0837707816583391),\n", " (4568, 0.0837707816583391),\n", " (4737, 0.0837707816583391),\n", " (315, 0.08346223261119858),\n", " (1142, 0.08346223261119858),\n", " (1589, 0.08346223261119858),\n", " (1749, 0.08346223261119858),\n", " (2167, 0.08346223261119858),\n", " (2304, 0.08346223261119858),\n", " (48, 0.0830812984794528),\n", " (403, 0.0830812984794528),\n", " (45, 0.08240856434303293),\n", " (1097, 0.08226127456606228),\n", " (1, 0.08226127456606226),\n", " (39, 0.08226127456606226),\n", " (152, 0.08226127456606226),\n", " (203, 0.08226127456606226),\n", " (341, 0.08226127456606226),\n", " (547, 0.08226127456606226),\n", " (626, 0.08226127456606226),\n", " (894, 0.08226127456606226),\n", " (1269, 0.08226127456606226),\n", " (1688, 0.08226127456606226),\n", " (2128, 0.08226127456606226),\n", " (2644, 0.08226127456606226),\n", " (2661, 0.08226127456606226),\n", " (2865, 0.08226127456606226),\n", " (3301, 0.08226127456606226),\n", " (3470, 0.08226127456606226),\n", " (3926, 0.08226127456606226),\n", " (63, 0.08175191193132876),\n", " (501, 0.08175191193132876),\n", " (2203, 0.08175191193132876),\n", " (38, 0.08111071056538127),\n", " (227, 0.08111071056538127),\n", " (241, 0.08111071056538127),\n", " (306, 0.08111071056538127),\n", " (381, 0.08111071056538127),\n", " (402, 0.08111071056538127),\n", " (787, 0.08111071056538127),\n", " (812, 0.08111071056538127),\n", " (866, 0.08111071056538127),\n", " (901, 0.08111071056538127),\n", " (1207, 0.08111071056538127),\n", " (1519, 0.08111071056538127),\n", " (1698, 0.08111071056538127),\n", " (1747, 0.08111071056538127),\n", " (2386, 0.08111071056538127),\n", " (2671, 0.08111071056538127),\n", " (2877, 0.08111071056538127),\n", " (3180, 0.08111071056538127),\n", " (3527, 0.08111071056538127),\n", " (3764, 0.08111071056538127),\n", " (4492, 0.08111071056538127),\n", " (4626, 0.08111071056538127),\n", " (4641, 0.08111071056538127),\n", " (4654, 0.08111071056538127),\n", " (4657, 0.08111071056538127),\n", " (2792, 0.08048436365855338),\n", " (4506, 0.08048436365855338),\n", " (486, 0.08031157077540446),\n", " (245, 0.08000711205939975),\n", " (854, 0.08000711205939975),\n", " (899, 0.08000711205939975),\n", " (2683, 0.08000711205939975),\n", " (3233, 0.08000711205939975),\n", " (3816, 0.08000711205939975),\n", " (3851, 0.08000711205939975),\n", " (1534, 0.07987230638308718),\n", " (1828, 0.07987230638308718),\n", " (51, 0.0792740035289418),\n", " (222, 0.0792740035289418),\n", " (16, 0.07894736842105264),\n", " (37, 0.07894736842105264),\n", " (164, 0.07894736842105264),\n", " (242, 0.07894736842105264),\n", " (1080, 0.07894736842105264),\n", " (1325, 0.07894736842105264),\n", " (3028, 0.07894736842105264),\n", " (4316, 0.07894736842105264),\n", " (193, 0.07878168645790681),\n", " (62, 0.07868894753646337),\n", " (103, 0.07868894753646337),\n", " (584, 0.07868894753646337),\n", " (1621, 0.07868894753646337),\n", " (1664, 0.07868894753646337),\n", " (1898, 0.07868894753646337),\n", " (2165, 0.07868894753646337),\n", " (2339, 0.07868894753646337),\n", " (4279, 0.07868894753646337),\n", " (4473, 0.07868894753646337),\n", " (125, 0.07817962860855646),\n", " (153, 0.0781166566864507),\n", " (286, 0.0781166566864507),\n", " (1926, 0.0781166566864507),\n", " (112, 0.07792865001991967),\n", " (329, 0.07792865001991967),\n", " (632, 0.07792865001991967),\n", " (922, 0.07792865001991967),\n", " (1161, 0.07792865001991967),\n", " (2295, 0.07792865001991967),\n", " (2938, 0.07792865001991967),\n", " (3164, 0.07792865001991967),\n", " (4341, 0.07792865001991967),\n", " (1282, 0.07755667343294813),\n", " (1659, 0.0770085628656519),\n", " (1924, 0.0770085628656519),\n", " (207, 0.07694837640638656),\n", " (1113, 0.07694837640638656),\n", " (2219, 0.07694837640638656),\n", " (2916, 0.07694837640638656),\n", " (3091, 0.07694837640638656),\n", " (3102, 0.07694837640638656),\n", " (776, 0.07647191129018727),\n", " (850, 0.07647191129018727),\n", " (1045, 0.07647191129018727),\n", " (1139, 0.07647191129018727),\n", " (1254, 0.07647191129018727),\n", " (2274, 0.07647191129018727),\n", " (3560, 0.07647191129018727),\n", " (3728, 0.07647191129018727),\n", " (3832, 0.07647191129018727),\n", " (4011, 0.07647191129018727),\n", " (40, 0.076004188790721),\n", " (70, 0.076004188790721),\n", " (96, 0.076004188790721),\n", " (101, 0.076004188790721),\n", " (174, 0.076004188790721),\n", " (235, 0.076004188790721),\n", " (349, 0.076004188790721),\n", " (492, 0.076004188790721),\n", " (1289, 0.076004188790721),\n", " (1290, 0.076004188790721),\n", " (2018, 0.076004188790721),\n", " (2449, 0.076004188790721),\n", " (4045, 0.076004188790721),\n", " (4268, 0.076004188790721),\n", " (4558, 0.076004188790721),\n", " (4624, 0.076004188790721),\n", " (246, 0.07543142864047142),\n", " (3331, 0.07530940414109724),\n", " (98, 0.07509392614826384),\n", " (361, 0.07509392614826384),\n", " (365, 0.07509392614826384),\n", " (680, 0.07509392614826384),\n", " (1009, 0.07509392614826384),\n", " (1293, 0.07509392614826384),\n", " (2021, 0.07509392614826384),\n", " (2163, 0.07509392614826384),\n", " (4205, 0.07509392614826384),\n", " (2005, 0.07492686492653551),\n", " (205, 0.07443229275647868),\n", " (800, 0.07443229275647868),\n", " (1005, 0.07443229275647868),\n", " (1323, 0.07443229275647868),\n", " (1521, 0.07443229275647868),\n", " (1770, 0.07443229275647868),\n", " (1990, 0.07443229275647868),\n", " (2256, 0.07443229275647868),\n", " (2326, 0.07443229275647868),\n", " (2445, 0.07443229275647868),\n", " (2712, 0.07443229275647868),\n", " (2801, 0.07443229275647868),\n", " (3117, 0.07443229275647868),\n", " (3126, 0.07443229275647868),\n", " (4165, 0.07443229275647868),\n", " (4412, 0.07443229275647868),\n", " (4542, 0.07443229275647868),\n", " (82, 0.07421560439929402),\n", " (210, 0.07421560439929402),\n", " (503, 0.07421560439929402),\n", " (540, 0.07421560439929402),\n", " (737, 0.07421560439929402),\n", " (1070, 0.07421560439929402),\n", " (1523, 0.07421560439929402),\n", " (3285, 0.07421560439929402),\n", " (3701, 0.07421560439929402),\n", " (2190, 0.07394738666465357),\n", " (3431, 0.07394738666465357),\n", " (1487, 0.0734718358370645),\n", " (634, 0.07336739820667779),\n", " (885, 0.07336739820667779),\n", " (1623, 0.07336739820667779),\n", " (2395, 0.07336739820667779),\n", " (2988, 0.07336739820667779),\n", " (3022, 0.07336739820667779),\n", " (3805, 0.07336739820667779),\n", " (4640, 0.07336739820667779),\n", " (2056, 0.07336739820667777),\n", " (3, 0.07300534327409847),\n", " (71, 0.07254762501100118),\n", " (784, 0.07254762501100118),\n", " (833, 0.07254762501100118),\n", " (908, 0.07254762501100118),\n", " (979, 0.07254762501100118),\n", " (1367, 0.07254762501100118),\n", " (1996, 0.07254762501100118),\n", " (2701, 0.07254762501100118),\n", " (3255, 0.07254762501100118),\n", " (3355, 0.07254762501100118),\n", " (179, 0.07254762501100116),\n", " (790, 0.07254762501100116),\n", " (995, 0.07254762501100116),\n", " (1489, 0.07254762501100116),\n", " (1655, 0.07254762501100116),\n", " (2212, 0.07254762501100116),\n", " (2297, 0.07254762501100116),\n", " (2317, 0.07254762501100116),\n", " (2772, 0.07254762501100116),\n", " (3069, 0.07254762501100116),\n", " (3072, 0.07254762501100116),\n", " (3103, 0.07254762501100116),\n", " (3155, 0.07254762501100116),\n", " (3430, 0.07254762501100116),\n", " (3716, 0.07254762501100116),\n", " (3976, 0.07254762501100116),\n", " (4431, 0.07254762501100116),\n", " (4443, 0.07254762501100116),\n", " (59, 0.07209840939145001),\n", " (76, 0.07175473098524099),\n", " (93, 0.07175473098524099),\n", " (1765, 0.07175473098524099),\n", " (1883, 0.07175473098524099),\n", " (2852, 0.07175473098524099),\n", " (3206, 0.07175473098524099),\n", " (3423, 0.07175473098524099),\n", " (3464, 0.07175473098524099),\n", " (4083, 0.07175473098524099),\n", " (1959, 0.07165743639000186),\n", " (175, 0.07098727864204515),\n", " (543, 0.07098727864204515),\n", " (728, 0.07098727864204515),\n", " (932, 0.07098727864204515),\n", " (1145, 0.07098727864204515),\n", " (1340, 0.07098727864204515),\n", " (2831, 0.07098727864204515),\n", " (3305, 0.07098727864204515),\n", " (3485, 0.07098727864204515),\n", " (3611, 0.07098727864204515),\n", " (4483, 0.07098727864204515),\n", " (1240, 0.07079923254047887),\n", " (1410, 0.07079923254047887),\n", " (2381, 0.07079923254047887),\n", " (2479, 0.07079923254047887),\n", " (2551, 0.07079923254047887),\n", " (2763, 0.07079923254047887),\n", " (3223, 0.07079923254047887),\n", " (4638, 0.07079923254047887),\n", " (86, 0.07024393586862707),\n", " (302, 0.07024393586862707),\n", " (674, 0.07024393586862707),\n", " (933, 0.07024393586862707),\n", " (1168, 0.07024393586862707),\n", " (1632, 0.07024393586862707),\n", " (2103, 0.07024393586862707),\n", " (2903, 0.07024393586862707),\n", " (3907, 0.07024393586862707),\n", " (55, 0.0695678476053965),\n", " (183, 0.0695678476053965),\n", " (97, 0.06952346619889824),\n", " (254, 0.06952346619889824),\n", " (271, 0.06952346619889824),\n", " (1457, 0.06952346619889824),\n", " (2527, 0.06952346619889824),\n", " (3300, 0.06952346619889824),\n", " (4180, 0.06952346619889824),\n", " (336, 0.06917144638660747),\n", " (1737, 0.06917144638660747),\n", " (2114, 0.06917144638660747),\n", " (2854, 0.06917144638660747),\n", " (3483, 0.06917144638660747),\n", " (3678, 0.06917144638660747),\n", " (3891, 0.06917144638660747),\n", " (600, 0.06882472016116853),\n", " (1278, 0.06882472016116853),\n", " (1538, 0.06882472016116853),\n", " (1847, 0.06882472016116853),\n", " (2209, 0.06882472016116853),\n", " (3310, 0.06882472016116853),\n", " (419, 0.06814662756363819),\n", " (671, 0.06814662756363819),\n", " (732, 0.06814662756363819),\n", " (782, 0.06814662756363819),\n", " (1146, 0.06814662756363819),\n", " (2002, 0.06814662756363819),\n", " (2243, 0.06814662756363819),\n", " (3910, 0.06814662756363819),\n", " (4123, 0.06814662756363819),\n", " (4392, 0.06814662756363819),\n", " (100, 0.06765100914917384),\n", " (498, 0.06765100914917384),\n", " (537, 0.06765100914917384),\n", " (1292, 0.06765100914917384),\n", " (1466, 0.06765100914917384),\n", " (1634, 0.06765100914917384),\n", " (1860, 0.06765100914917384),\n", " (2435, 0.06765100914917384),\n", " (2533, 0.06765100914917384),\n", " (2622, 0.06765100914917384),\n", " (2664, 0.06765100914917384),\n", " (2890, 0.06765100914917384),\n", " (4019, 0.06765100914917384),\n", " (4216, 0.06765100914917384),\n", " (4290, 0.06765100914917384),\n", " (124, 0.06748819059987714),\n", " (665, 0.06748819059987714),\n", " (704, 0.06748819059987714),\n", " (734, 0.06748819059987714),\n", " (2035, 0.06748819059987714),\n", " (2305, 0.06748819059987714),\n", " (3020, 0.06748819059987714),\n", " (488, 0.06692744814102547),\n", " (58, 0.06684847767323797),\n", " (215, 0.06684847767323797),\n", " (1445, 0.06684847767323797),\n", " (2596, 0.06684847767323797),\n", " (3225, 0.06684847767323797),\n", " (3588, 0.06684847767323797),\n", " (22, 0.0662266178532522),\n", " (109, 0.0662266178532522),\n", " (209, 0.0662266178532522),\n", " (267, 0.0662266178532522),\n", " (308, 0.0662266178532522),\n", " (570, 0.0662266178532522),\n", " (604, 0.0662266178532522),\n", " (1085, 0.0662266178532522),\n", " (1381, 0.0662266178532522),\n", " (2218, 0.0662266178532522),\n", " (2743, 0.0662266178532522),\n", " (2976, 0.0662266178532522),\n", " (3241, 0.0662266178532522),\n", " (3398, 0.0662266178532522),\n", " (3412, 0.0662266178532522),\n", " (3994, 0.0662266178532522),\n", " (4061, 0.0662266178532522),\n", " (4351, 0.0662266178532522),\n", " (4623, 0.0662266178532522),\n", " (30, 0.06622661785325219),\n", " (212, 0.06622661785325219),\n", " (635, 0.06622661785325219),\n", " (735, 0.06622661785325219),\n", " (1121, 0.06622661785325219),\n", " (1432, 0.06622661785325219),\n", " (2302, 0.06622661785325219),\n", " (2320, 0.06622661785325219),\n", " (2404, 0.06622661785325219),\n", " (1018, 0.06562179588897107),\n", " (1087, 0.06562179588897107),\n", " (2135, 0.06562179588897107),\n", " (2657, 0.06562179588897107),\n", " (3879, 0.06562179588897107),\n", " (304, 0.06557412294705281),\n", " (2832, 0.06521546507260247),\n", " (29, 0.065033247714309),\n", " (253, 0.065033247714309),\n", " (1175, 0.065033247714309),\n", " (2003, 0.065033247714309),\n", " (2052, 0.065033247714309),\n", " (3390, 0.065033247714309),\n", " (3635, 0.065033247714309),\n", " (3822, 0.065033247714309),\n", " (216, 0.06488856845230502),\n", " (237, 0.06488856845230502),\n", " (621, 0.06488856845230502),\n", " (695, 0.06488856845230502),\n", " (951, 0.06488856845230502),\n", " (1068, 0.06488856845230502),\n", " (1171, 0.06488856845230502),\n", " (1262, 0.06488856845230502),\n", " (1304, 0.06488856845230502),\n", " (1438, 0.06488856845230502),\n", " (1486, 0.06488856845230502),\n", " (2250, 0.06488856845230502),\n", " (2259, 0.06488856845230502),\n", " (2268, 0.06488856845230502),\n", " (2309, 0.06488856845230502),\n", " (2579, 0.06488856845230502),\n", " (2715, 0.06488856845230502),\n", " (2882, 0.06488856845230502),\n", " (3181, 0.06488856845230502),\n", " (3253, 0.06488856845230502),\n", " (3572, 0.06488856845230502),\n", " (3901, 0.06488856845230502),\n", " (3929, 0.06488856845230502),\n", " (4312, 0.06488856845230502),\n", " (281, 0.06446025638903101),\n", " (447, 0.06446025638903101),\n", " (1011, 0.06446025638903101),\n", " (1531, 0.06446025638903101),\n", " (3174, 0.06446025638903101),\n", " (2519, 0.06424925662032356),\n", " (425, 0.06390214842634574),\n", " (471, 0.06390214842634574),\n", " (746, 0.06390214842634574),\n", " (1848, 0.06390214842634574),\n", " (1979, 0.06390214842634574),\n", " (2264, 0.06390214842634574),\n", " (546, 0.06362847629757779),\n", " (744, 0.06362847629757779),\n", " (1365, 0.06362847629757779),\n", " (1854, 0.06362847629757779),\n", " (1950, 0.06362847629757779),\n", " (2113, 0.06362847629757779),\n", " (2270, 0.06362847629757779),\n", " (3374, 0.06362847629757779),\n", " (3931, 0.06362847629757779),\n", " (4006, 0.06362847629757779),\n", " (4355, 0.06362847629757779),\n", " (4357, 0.06362847629757779),\n", " (612, 0.06335829046432676),\n", " (1462, 0.06335829046432676),\n", " (15, 0.06282808624375433),\n", " (443, 0.06282808624375433),\n", " (591, 0.06282808624375433),\n", " (1093, 0.06282808624375433),\n", " (2319, 0.06282808624375433),\n", " (2888, 0.06282808624375433),\n", " (3344, 0.06282808624375433),\n", " (3607, 0.06282808624375433),\n", " (90, 0.06243905410544627),\n", " (117, 0.06243905410544627),\n", " (159, 0.06243905410544627),\n", " (290, 0.06243905410544627),\n", " (404, 0.06243905410544627),\n", " (957, 0.06243905410544627),\n", " (1707, 0.06243905410544627),\n", " (2228, 0.06243905410544627),\n", " (2620, 0.06243905410544627),\n", " (3118, 0.06243905410544627),\n", " (3133, 0.06243905410544627),\n", " (4664, 0.06243905410544627),\n", " (4704, 0.06243905410544627),\n", " (79, 0.0623109738595896),\n", " (92, 0.0623109738595896),\n", " (963, 0.0623109738595896),\n", " (1030, 0.0623109738595896),\n", " (1202, 0.0623109738595896),\n", " (2520, 0.0623109738595896),\n", " (3298, 0.0623109738595896),\n", " (3740, 0.0623109738595896),\n", " (106, 0.061806423257274694),\n", " (107, 0.061806423257274694),\n", " (836, 0.061806423257274694),\n", " (1191, 0.061806423257274694),\n", " (3078, 0.061806423257274694),\n", " (154, 0.06131393394849658),\n", " (259, 0.06131393394849658),\n", " (276, 0.06131393394849658),\n", " (309, 0.06131393394849658),\n", " (615, 0.06131393394849658),\n", " (945, 0.06131393394849658),\n", " (993, 0.06131393394849658),\n", " (1076, 0.06131393394849658),\n", " (1092, 0.06131393394849658),\n", " (1147, 0.06131393394849658),\n", " (1347, 0.06131393394849658),\n", " (1605, 0.06131393394849658),\n", " (1606, 0.06131393394849658),\n", " (1607, 0.06131393394849658),\n", " (1973, 0.06131393394849658),\n", " (2120, 0.06131393394849658),\n", " (2127, 0.06131393394849658),\n", " (2538, 0.06131393394849658),\n", " (2600, 0.06131393394849658),\n", " (2948, 0.06131393394849658),\n", " (3770, 0.06131393394849658),\n", " (3834, 0.06131393394849658),\n", " (4196, 0.06131393394849658),\n", " (4320, 0.06131393394849658),\n", " (4566, 0.06131393394849658),\n", " (4652, 0.06131393394849658),\n", " (733, 0.061313933948496574),\n", " (156, 0.060833032924035954),\n", " (375, 0.060833032924035954),\n", " (455, 0.060833032924035954),\n", " (1356, 0.060833032924035954),\n", " (3777, 0.060833032924035954),\n", " (4789, 0.060833032924035954),\n", " (224, 0.060363272743915036),\n", " (768, 0.060363272743915036),\n", " (1103, 0.060363272743915036),\n", " (4077, 0.060363272743915036),\n", " (348, 0.0602475233128778),\n", " (533, 0.0602475233128778),\n", " (664, 0.0602475233128778),\n", " (1408, 0.0602475233128778),\n", " (1434, 0.0602475233128778),\n", " (1584, 0.0602475233128778),\n", " (1631, 0.0602475233128778),\n", " (1944, 0.0602475233128778),\n", " (2159, 0.0602475233128778),\n", " ...]" ] }, "execution_count": 97, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sorted(list(enumerate(similarity[0])),reverse=True,key=lambda x:x[1])" ] }, { "cell_type": "code", "execution_count": 101, "id": "6d7c9bb7", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Aliens vs Predator: Requiem\n", "Aliens\n", "Independence Day\n", "Falcon Rising\n", "Titan A.E.\n" ] } ], "source": [ "recommend('Avatar')" ] }, { "cell_type": "code", "execution_count": 102, "id": "8b93f359", "metadata": {}, "outputs": [], "source": [ "import pickle" ] }, { "cell_type": "code", "execution_count": 103, "id": "eb19967d", "metadata": {}, "outputs": [], "source": [ "pickle.dump(new_df,open('model/movies_list.pkl','wb'))" ] }, { "cell_type": "code", "execution_count": 104, "id": "00815c07", "metadata": {}, "outputs": [], "source": [ "pickle.dump(similarity,open('model/similarity.pkl','wb'))" ] }, { "cell_type": "code", "execution_count": null, "id": "55d57fda", "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.10.7" } }, "nbformat": 4, "nbformat_minor": 5 }