{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "0d6c39ba", "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import pandas as pd" ] }, { "cell_type": "code", "execution_count": 2, "id": "28cc7e2f", "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": 3, "id": "3cc513ad", "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": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movies.head()" ] }, { "cell_type": "code", "execution_count": 4, "id": "af814810", "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", "
movie_idtitlecastcrew
019995Avatar[{\"cast_id\": 242, \"character\": \"Jake Sully\", \"...[{\"credit_id\": \"52fe48009251416c750aca23\", \"de...
1285Pirates of the Caribbean: At World's End[{\"cast_id\": 4, \"character\": \"Captain Jack Spa...[{\"credit_id\": \"52fe4232c3a36847f800b579\", \"de...
2206647Spectre[{\"cast_id\": 1, \"character\": \"James Bond\", \"cr...[{\"credit_id\": \"54805967c3a36829b5002c41\", \"de...
349026The Dark Knight Rises[{\"cast_id\": 2, \"character\": \"Bruce Wayne / Ba...[{\"credit_id\": \"52fe4781c3a36847f81398c3\", \"de...
449529John Carter[{\"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", " 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": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "credits.head()" ] }, { "cell_type": "code", "execution_count": 5, "id": "32488aa4", "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": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "credits.head()['crew'].values[:1]" ] }, { "cell_type": "code", "execution_count": 6, "id": "2fd70552", "metadata": {}, "outputs": [], "source": [ "#merging \n", "movies=movies.merge(credits,on='title')" ] }, { "cell_type": "code", "execution_count": 7, "id": "9f0c3b45", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
budgetgenreshomepageidkeywordsoriginal_languageoriginal_titleoverviewpopularityproduction_companies...runtimespoken_languagesstatustaglinetitlevote_averagevote_countmovie_idcastcrew
0237000000[{\"id\": 28, \"name\": \"Action\"}, {\"id\": 12, \"nam...http://www.avatarmovie.com/19995[{\"id\": 1463, \"name\": \"culture clash\"}, {\"id\":...enAvatarIn the 22nd century, a paraplegic Marine is di...150.437577[{\"name\": \"Ingenious Film Partners\", \"id\": 289......162.0[{\"iso_639_1\": \"en\", \"name\": \"English\"}, {\"iso...ReleasedEnter the World of Pandora.Avatar7.21180019995[{\"cast_id\": 242, \"character\": \"Jake Sully\", \"...[{\"credit_id\": \"52fe48009251416c750aca23\", \"de...
1300000000[{\"id\": 12, \"name\": \"Adventure\"}, {\"id\": 14, \"...http://disney.go.com/disneypictures/pirates/285[{\"id\": 270, \"name\": \"ocean\"}, {\"id\": 726, \"na...enPirates of the Caribbean: At World's EndCaptain Barbossa, long believed to be dead, ha...139.082615[{\"name\": \"Walt Disney Pictures\", \"id\": 2}, {\"......169.0[{\"iso_639_1\": \"en\", \"name\": \"English\"}]ReleasedAt the end of the world, the adventure begins.Pirates of the Caribbean: At World's End6.94500285[{\"cast_id\": 4, \"character\": \"Captain Jack Spa...[{\"credit_id\": \"52fe4232c3a36847f800b579\", \"de...
2245000000[{\"id\": 28, \"name\": \"Action\"}, {\"id\": 12, \"nam...http://www.sonypictures.com/movies/spectre/206647[{\"id\": 470, \"name\": \"spy\"}, {\"id\": 818, \"name...enSpectreA cryptic message from Bond’s past sends him o...107.376788[{\"name\": \"Columbia Pictures\", \"id\": 5}, {\"nam......148.0[{\"iso_639_1\": \"fr\", \"name\": \"Fran\\u00e7ais\"},...ReleasedA Plan No One EscapesSpectre6.34466206647[{\"cast_id\": 1, \"character\": \"James Bond\", \"cr...[{\"credit_id\": \"54805967c3a36829b5002c41\", \"de...
3250000000[{\"id\": 28, \"name\": \"Action\"}, {\"id\": 80, \"nam...http://www.thedarkknightrises.com/49026[{\"id\": 849, \"name\": \"dc comics\"}, {\"id\": 853,...enThe Dark Knight RisesFollowing the death of District Attorney Harve...112.312950[{\"name\": \"Legendary Pictures\", \"id\": 923}, {\"......165.0[{\"iso_639_1\": \"en\", \"name\": \"English\"}]ReleasedThe Legend EndsThe Dark Knight Rises7.6910649026[{\"cast_id\": 2, \"character\": \"Bruce Wayne / Ba...[{\"credit_id\": \"52fe4781c3a36847f81398c3\", \"de...
4260000000[{\"id\": 28, \"name\": \"Action\"}, {\"id\": 12, \"nam...http://movies.disney.com/john-carter49529[{\"id\": 818, \"name\": \"based on novel\"}, {\"id\":...enJohn CarterJohn Carter is a war-weary, former military ca...43.926995[{\"name\": \"Walt Disney Pictures\", \"id\": 2}]...132.0[{\"iso_639_1\": \"en\", \"name\": \"English\"}]ReleasedLost in our world, found in another.John Carter6.1212449529[{\"cast_id\": 5, \"character\": \"John Carter\", \"c...[{\"credit_id\": \"52fe479ac3a36847f813eaa3\", \"de...
\n", "

5 rows × 23 columns

\n", "
" ], "text/plain": [ " budget genres \\\n", "0 237000000 [{\"id\": 28, \"name\": \"Action\"}, {\"id\": 12, \"nam... \n", "1 300000000 [{\"id\": 12, \"name\": \"Adventure\"}, {\"id\": 14, \"... \n", "2 245000000 [{\"id\": 28, \"name\": \"Action\"}, {\"id\": 12, \"nam... \n", "3 250000000 [{\"id\": 28, \"name\": \"Action\"}, {\"id\": 80, \"nam... \n", "4 260000000 [{\"id\": 28, \"name\": \"Action\"}, {\"id\": 12, \"nam... \n", "\n", " homepage id \\\n", "0 http://www.avatarmovie.com/ 19995 \n", "1 http://disney.go.com/disneypictures/pirates/ 285 \n", "2 http://www.sonypictures.com/movies/spectre/ 206647 \n", "3 http://www.thedarkknightrises.com/ 49026 \n", "4 http://movies.disney.com/john-carter 49529 \n", "\n", " keywords original_language \\\n", "0 [{\"id\": 1463, \"name\": \"culture clash\"}, {\"id\":... en \n", "1 [{\"id\": 270, \"name\": \"ocean\"}, {\"id\": 726, \"na... en \n", "2 [{\"id\": 470, \"name\": \"spy\"}, {\"id\": 818, \"name... en \n", "3 [{\"id\": 849, \"name\": \"dc comics\"}, {\"id\": 853,... en \n", "4 [{\"id\": 818, \"name\": \"based on novel\"}, {\"id\":... en \n", "\n", " original_title \\\n", "0 Avatar \n", "1 Pirates of the Caribbean: At World's End \n", "2 Spectre \n", "3 The Dark Knight Rises \n", "4 John Carter \n", "\n", " overview popularity \\\n", "0 In the 22nd century, a paraplegic Marine is di... 150.437577 \n", "1 Captain Barbossa, long believed to be dead, ha... 139.082615 \n", "2 A cryptic message from Bond’s past sends him o... 107.376788 \n", "3 Following the death of District Attorney Harve... 112.312950 \n", "4 John Carter is a war-weary, former military ca... 43.926995 \n", "\n", " production_companies ... runtime \\\n", "0 [{\"name\": \"Ingenious Film Partners\", \"id\": 289... ... 162.0 \n", "1 [{\"name\": \"Walt Disney Pictures\", \"id\": 2}, {\"... ... 169.0 \n", "2 [{\"name\": \"Columbia Pictures\", \"id\": 5}, {\"nam... ... 148.0 \n", "3 [{\"name\": \"Legendary Pictures\", \"id\": 923}, {\"... ... 165.0 \n", "4 [{\"name\": \"Walt Disney Pictures\", \"id\": 2}] ... 132.0 \n", "\n", " spoken_languages status \\\n", "0 [{\"iso_639_1\": \"en\", \"name\": \"English\"}, {\"iso... Released \n", "1 [{\"iso_639_1\": \"en\", \"name\": \"English\"}] Released \n", "2 [{\"iso_639_1\": \"fr\", \"name\": \"Fran\\u00e7ais\"},... Released \n", "3 [{\"iso_639_1\": \"en\", \"name\": \"English\"}] Released \n", "4 [{\"iso_639_1\": \"en\", \"name\": \"English\"}] Released \n", "\n", " tagline \\\n", "0 Enter the World of Pandora. \n", "1 At the end of the world, the adventure begins. \n", "2 A Plan No One Escapes \n", "3 The Legend Ends \n", "4 Lost in our world, found in another. \n", "\n", " title vote_average vote_count movie_id \\\n", "0 Avatar 7.2 11800 19995 \n", "1 Pirates of the Caribbean: At World's End 6.9 4500 285 \n", "2 Spectre 6.3 4466 206647 \n", "3 The Dark Knight Rises 7.6 9106 49026 \n", "4 John Carter 6.1 2124 49529 \n", "\n", " cast \\\n", "0 [{\"cast_id\": 242, \"character\": \"Jake Sully\", \"... \n", "1 [{\"cast_id\": 4, \"character\": \"Captain Jack Spa... \n", "2 [{\"cast_id\": 1, \"character\": \"James Bond\", \"cr... \n", "3 [{\"cast_id\": 2, \"character\": \"Bruce Wayne / Ba... \n", "4 [{\"cast_id\": 5, \"character\": \"John Carter\", \"c... \n", "\n", " crew \n", "0 [{\"credit_id\": \"52fe48009251416c750aca23\", \"de... \n", "1 [{\"credit_id\": \"52fe4232c3a36847f800b579\", \"de... \n", "2 [{\"credit_id\": \"54805967c3a36829b5002c41\", \"de... \n", "3 [{\"credit_id\": \"52fe4781c3a36847f81398c3\", \"de... \n", "4 [{\"credit_id\": \"52fe479ac3a36847f813eaa3\", \"de... \n", "\n", "[5 rows x 23 columns]" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movies.head()" ] }, { "cell_type": "code", "execution_count": 8, "id": "71fa2689", "metadata": {}, "outputs": [], "source": [ "#geners\n", "#id\n", "#keywords\n", "#title\n", "#overview\n", "#cast \n", "#crew\n", "movies=movies[['movie_id','title','overview','keywords','genres','cast','crew']]" ] }, { "cell_type": "code", "execution_count": 9, "id": "1d722e91", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "Int64Index: 4809 entries, 0 to 4808\n", "Data columns (total 7 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 movie_id 4809 non-null int64 \n", " 1 title 4809 non-null object\n", " 2 overview 4806 non-null object\n", " 3 keywords 4809 non-null object\n", " 4 genres 4809 non-null object\n", " 5 cast 4809 non-null object\n", " 6 crew 4809 non-null object\n", "dtypes: int64(1), object(6)\n", "memory usage: 300.6+ KB\n" ] } ], "source": [ "movies.info()" ] }, { "cell_type": "code", "execution_count": 10, "id": "86c20601", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "movie_id 0\n", "title 0\n", "overview 3\n", "keywords 0\n", "genres 0\n", "cast 0\n", "crew 0\n", "dtype: int64" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movies.isnull().sum()" ] }, { "cell_type": "code", "execution_count": 11, "id": "32254f67", "metadata": {}, "outputs": [], "source": [ "movies.dropna(inplace=True)" ] }, { "cell_type": "code", "execution_count": 12, "id": "309a6381", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movies.duplicated().sum()" ] }, { "cell_type": "code", "execution_count": 13, "id": "d675b458", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'[{\"id\": 28, \"name\": \"Action\"}, {\"id\": 12, \"name\": \"Adventure\"}, {\"id\": 14, \"name\": \"Fantasy\"}, {\"id\": 878, \"name\": \"Science Fiction\"}]'" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movies.iloc[0].genres" ] }, { "cell_type": "code", "execution_count": 14, "id": "1a63853a", "metadata": {}, "outputs": [], "source": [ "# '[{\"id\": 28, \"name\": \"Action\"}, {\"id\": 12, \"name\": \"Adventure\"}, {\"id\": 14, \"name\": \"Fantasy\"}, {\"id\": 878, \"name\": \"Science Fiction\"}]'\n", "# ['Action','Adventure',]->like this banan hai" ] }, { "cell_type": "code", "execution_count": 15, "id": "97f9df7f", "metadata": {}, "outputs": [], "source": [ "def convert(obj):\n", " l=[]\n", " for i in ast.literal_eval(obj):\n", " l.append(i['name'])\n", " return l\n" ] }, { "cell_type": "code", "execution_count": 16, "id": "1ee9d92e", "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": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import ast\n", "ast.literal_eval('[{\"id\": 28, \"name\": \"Action\"}, {\"id\": 12, \"name\": \"Adventure\"}, {\"id\": 14, \"name\": \"Fantasy\"}, {\"id\": 878, \"name\": \"Science Fiction\"}]')" ] }, { "cell_type": "code", "execution_count": 17, "id": "a2827fb0", "metadata": {}, "outputs": [], "source": [ "movies['genres']=movies['genres'].apply(convert)" ] }, { "cell_type": "code", "execution_count": 18, "id": "d4829bf5", "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_idtitleoverviewkeywordsgenrescastcrew
019995AvatarIn the 22nd century, a paraplegic Marine is di...[{\"id\": 1463, \"name\": \"culture clash\"}, {\"id\":...[Action, Adventure, Fantasy, Science Fiction][{\"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\": 270, \"name\": \"ocean\"}, {\"id\": 726, \"na...[Adventure, Fantasy, Action][{\"cast_id\": 4, \"character\": \"Captain Jack Spa...[{\"credit_id\": \"52fe4232c3a36847f800b579\", \"de...
2206647SpectreA cryptic message from Bond’s past sends him o...[{\"id\": 470, \"name\": \"spy\"}, {\"id\": 818, \"name...[Action, Adventure, Crime][{\"cast_id\": 1, \"character\": \"James Bond\", \"cr...[{\"credit_id\": \"54805967c3a36829b5002c41\", \"de...
349026The Dark Knight RisesFollowing the death of District Attorney Harve...[{\"id\": 849, \"name\": \"dc comics\"}, {\"id\": 853,...[Action, Crime, Drama, Thriller][{\"cast_id\": 2, \"character\": \"Bruce Wayne / Ba...[{\"credit_id\": \"52fe4781c3a36847f81398c3\", \"de...
449529John CarterJohn Carter is a war-weary, former military ca...[{\"id\": 818, \"name\": \"based on novel\"}, {\"id\":...[Action, Adventure, Science Fiction][{\"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", " 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", " 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", " 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": 18, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movies.head()" ] }, { "cell_type": "code", "execution_count": 19, "id": "cd74cfc3", "metadata": {}, "outputs": [], "source": [ "movies['keywords']=movies['keywords'].apply(convert)\n" ] }, { "cell_type": "code", "execution_count": 20, "id": "ccbe64c6", "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_idtitleoverviewkeywordsgenrescastcrew
019995AvatarIn the 22nd century, a paraplegic Marine is di...[culture clash, future, space war, space colon...[Action, Adventure, Fantasy, Science Fiction][{\"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...[ocean, drug abuse, exotic island, east india ...[Adventure, Fantasy, Action][{\"cast_id\": 4, \"character\": \"Captain Jack Spa...[{\"credit_id\": \"52fe4232c3a36847f800b579\", \"de...
2206647SpectreA cryptic message from Bond’s past sends him o...[spy, based on novel, secret agent, sequel, mi...[Action, Adventure, Crime][{\"cast_id\": 1, \"character\": \"James Bond\", \"cr...[{\"credit_id\": \"54805967c3a36829b5002c41\", \"de...
349026The Dark Knight RisesFollowing the death of District Attorney Harve...[dc comics, crime fighter, terrorist, secret i...[Action, Crime, Drama, Thriller][{\"cast_id\": 2, \"character\": \"Bruce Wayne / Ba...[{\"credit_id\": \"52fe4781c3a36847f81398c3\", \"de...
449529John CarterJohn Carter is a war-weary, former military ca...[based on novel, mars, medallion, space travel...[Action, Adventure, Science Fiction][{\"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", " 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", " 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", " 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": 20, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movies.head()" ] }, { "cell_type": "code", "execution_count": 21, "id": "80c6cbfb", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'[{\"cast_id\": 242, \"character\": \"Jake Sully\", \"credit_id\": \"5602a8a7c3a3685532001c9a\", \"gender\": 2, \"id\": 65731, \"name\": \"Sam Worthington\", \"order\": 0}, {\"cast_id\": 3, \"character\": \"Neytiri\", \"credit_id\": \"52fe48009251416c750ac9cb\", \"gender\": 1, \"id\": 8691, \"name\": \"Zoe Saldana\", \"order\": 1}, {\"cast_id\": 25, \"character\": \"Dr. Grace Augustine\", \"credit_id\": \"52fe48009251416c750aca39\", \"gender\": 1, \"id\": 10205, \"name\": \"Sigourney Weaver\", \"order\": 2}, {\"cast_id\": 4, \"character\": \"Col. Quaritch\", \"credit_id\": \"52fe48009251416c750ac9cf\", \"gender\": 2, \"id\": 32747, \"name\": \"Stephen Lang\", \"order\": 3}, {\"cast_id\": 5, \"character\": \"Trudy Chacon\", \"credit_id\": \"52fe48009251416c750ac9d3\", \"gender\": 1, \"id\": 17647, \"name\": \"Michelle Rodriguez\", \"order\": 4}, {\"cast_id\": 8, \"character\": \"Selfridge\", \"credit_id\": \"52fe48009251416c750ac9e1\", \"gender\": 2, \"id\": 1771, \"name\": \"Giovanni Ribisi\", \"order\": 5}, {\"cast_id\": 7, \"character\": \"Norm Spellman\", \"credit_id\": \"52fe48009251416c750ac9dd\", \"gender\": 2, \"id\": 59231, \"name\": \"Joel David Moore\", \"order\": 6}, {\"cast_id\": 9, \"character\": \"Moat\", \"credit_id\": \"52fe48009251416c750ac9e5\", \"gender\": 1, \"id\": 30485, \"name\": \"CCH Pounder\", \"order\": 7}, {\"cast_id\": 11, \"character\": \"Eytukan\", \"credit_id\": \"52fe48009251416c750ac9ed\", \"gender\": 2, \"id\": 15853, \"name\": \"Wes Studi\", \"order\": 8}, {\"cast_id\": 10, \"character\": \"Tsu\\'Tey\", \"credit_id\": \"52fe48009251416c750ac9e9\", \"gender\": 2, \"id\": 10964, \"name\": \"Laz Alonso\", \"order\": 9}, {\"cast_id\": 12, \"character\": \"Dr. Max Patel\", \"credit_id\": \"52fe48009251416c750ac9f1\", \"gender\": 2, \"id\": 95697, \"name\": \"Dileep Rao\", \"order\": 10}, {\"cast_id\": 13, \"character\": \"Lyle Wainfleet\", \"credit_id\": \"52fe48009251416c750ac9f5\", \"gender\": 2, \"id\": 98215, \"name\": \"Matt Gerald\", \"order\": 11}, {\"cast_id\": 32, \"character\": \"Private Fike\", \"credit_id\": \"52fe48009251416c750aca5b\", \"gender\": 2, \"id\": 154153, \"name\": \"Sean Anthony Moran\", \"order\": 12}, {\"cast_id\": 33, \"character\": \"Cryo Vault Med Tech\", \"credit_id\": \"52fe48009251416c750aca5f\", \"gender\": 2, \"id\": 397312, \"name\": \"Jason Whyte\", \"order\": 13}, {\"cast_id\": 34, \"character\": \"Venture Star Crew Chief\", \"credit_id\": \"52fe48009251416c750aca63\", \"gender\": 2, \"id\": 42317, \"name\": \"Scott Lawrence\", \"order\": 14}, {\"cast_id\": 35, \"character\": \"Lock Up Trooper\", \"credit_id\": \"52fe48009251416c750aca67\", \"gender\": 2, \"id\": 986734, \"name\": \"Kelly Kilgour\", \"order\": 15}, {\"cast_id\": 36, \"character\": \"Shuttle Pilot\", \"credit_id\": \"52fe48009251416c750aca6b\", \"gender\": 0, \"id\": 1207227, \"name\": \"James Patrick Pitt\", \"order\": 16}, {\"cast_id\": 37, \"character\": \"Shuttle Co-Pilot\", \"credit_id\": \"52fe48009251416c750aca6f\", \"gender\": 0, \"id\": 1180936, \"name\": \"Sean Patrick Murphy\", \"order\": 17}, {\"cast_id\": 38, \"character\": \"Shuttle Crew Chief\", \"credit_id\": \"52fe48009251416c750aca73\", \"gender\": 2, \"id\": 1019578, \"name\": \"Peter Dillon\", \"order\": 18}, {\"cast_id\": 39, \"character\": \"Tractor Operator / Troupe\", \"credit_id\": \"52fe48009251416c750aca77\", \"gender\": 0, \"id\": 91443, \"name\": \"Kevin Dorman\", \"order\": 19}, {\"cast_id\": 40, \"character\": \"Dragon Gunship Pilot\", \"credit_id\": \"52fe48009251416c750aca7b\", \"gender\": 2, \"id\": 173391, \"name\": \"Kelson Henderson\", \"order\": 20}, {\"cast_id\": 41, \"character\": \"Dragon Gunship Gunner\", \"credit_id\": \"52fe48009251416c750aca7f\", \"gender\": 0, \"id\": 1207236, \"name\": \"David Van Horn\", \"order\": 21}, {\"cast_id\": 42, \"character\": \"Dragon Gunship Navigator\", \"credit_id\": \"52fe48009251416c750aca83\", \"gender\": 0, \"id\": 215913, \"name\": \"Jacob Tomuri\", \"order\": 22}, {\"cast_id\": 43, \"character\": \"Suit #1\", \"credit_id\": \"52fe48009251416c750aca87\", \"gender\": 0, \"id\": 143206, \"name\": \"Michael Blain-Rozgay\", \"order\": 23}, {\"cast_id\": 44, \"character\": \"Suit #2\", \"credit_id\": \"52fe48009251416c750aca8b\", \"gender\": 2, \"id\": 169676, \"name\": \"Jon Curry\", \"order\": 24}, {\"cast_id\": 46, \"character\": \"Ambient Room Tech\", \"credit_id\": \"52fe48009251416c750aca8f\", \"gender\": 0, \"id\": 1048610, \"name\": \"Luke Hawker\", \"order\": 25}, {\"cast_id\": 47, \"character\": \"Ambient Room Tech / Troupe\", \"credit_id\": \"52fe48009251416c750aca93\", \"gender\": 0, \"id\": 42288, \"name\": \"Woody Schultz\", \"order\": 26}, {\"cast_id\": 48, \"character\": \"Horse Clan Leader\", \"credit_id\": \"52fe48009251416c750aca97\", \"gender\": 2, \"id\": 68278, \"name\": \"Peter Mensah\", \"order\": 27}, {\"cast_id\": 49, \"character\": \"Link Room Tech\", \"credit_id\": \"52fe48009251416c750aca9b\", \"gender\": 0, \"id\": 1207247, \"name\": \"Sonia Yee\", \"order\": 28}, {\"cast_id\": 50, \"character\": \"Basketball Avatar / Troupe\", \"credit_id\": \"52fe48009251416c750aca9f\", \"gender\": 1, \"id\": 1207248, \"name\": \"Jahnel Curfman\", \"order\": 29}, {\"cast_id\": 51, \"character\": \"Basketball Avatar\", \"credit_id\": \"52fe48009251416c750acaa3\", \"gender\": 0, \"id\": 89714, \"name\": \"Ilram Choi\", \"order\": 30}, {\"cast_id\": 52, \"character\": \"Na\\'vi Child\", \"credit_id\": \"52fe48009251416c750acaa7\", \"gender\": 0, \"id\": 1207249, \"name\": \"Kyla Warren\", \"order\": 31}, {\"cast_id\": 53, \"character\": \"Troupe\", \"credit_id\": \"52fe48009251416c750acaab\", \"gender\": 0, \"id\": 1207250, \"name\": \"Lisa Roumain\", \"order\": 32}, {\"cast_id\": 54, \"character\": \"Troupe\", \"credit_id\": \"52fe48009251416c750acaaf\", \"gender\": 1, \"id\": 83105, \"name\": \"Debra Wilson\", \"order\": 33}, {\"cast_id\": 57, \"character\": \"Troupe\", \"credit_id\": \"52fe48009251416c750acabb\", \"gender\": 0, \"id\": 1207253, \"name\": \"Chris Mala\", \"order\": 34}, {\"cast_id\": 55, \"character\": \"Troupe\", \"credit_id\": \"52fe48009251416c750acab3\", \"gender\": 0, \"id\": 1207251, \"name\": \"Taylor Kibby\", \"order\": 35}, {\"cast_id\": 56, \"character\": \"Troupe\", \"credit_id\": \"52fe48009251416c750acab7\", \"gender\": 0, \"id\": 1207252, \"name\": \"Jodie Landau\", \"order\": 36}, {\"cast_id\": 58, \"character\": \"Troupe\", \"credit_id\": \"52fe48009251416c750acabf\", \"gender\": 0, \"id\": 1207254, \"name\": \"Julie Lamm\", \"order\": 37}, {\"cast_id\": 59, \"character\": \"Troupe\", \"credit_id\": \"52fe48009251416c750acac3\", \"gender\": 0, \"id\": 1207257, \"name\": \"Cullen B. Madden\", \"order\": 38}, {\"cast_id\": 60, \"character\": \"Troupe\", \"credit_id\": \"52fe48009251416c750acac7\", \"gender\": 0, \"id\": 1207259, \"name\": \"Joseph Brady Madden\", \"order\": 39}, {\"cast_id\": 61, \"character\": \"Troupe\", \"credit_id\": \"52fe48009251416c750acacb\", \"gender\": 0, \"id\": 1207262, \"name\": \"Frankie Torres\", \"order\": 40}, {\"cast_id\": 62, \"character\": \"Troupe\", \"credit_id\": \"52fe48009251416c750acacf\", \"gender\": 1, \"id\": 1158600, \"name\": \"Austin Wilson\", \"order\": 41}, {\"cast_id\": 63, \"character\": \"Troupe\", \"credit_id\": \"52fe48019251416c750acad3\", \"gender\": 1, \"id\": 983705, \"name\": \"Sara Wilson\", \"order\": 42}, {\"cast_id\": 64, \"character\": \"Troupe\", \"credit_id\": \"52fe48019251416c750acad7\", \"gender\": 0, \"id\": 1207263, \"name\": \"Tamica Washington-Miller\", \"order\": 43}, {\"cast_id\": 65, \"character\": \"Op Center Staff\", \"credit_id\": \"52fe48019251416c750acadb\", \"gender\": 1, \"id\": 1145098, \"name\": \"Lucy Briant\", \"order\": 44}, {\"cast_id\": 66, \"character\": \"Op Center Staff\", \"credit_id\": \"52fe48019251416c750acadf\", \"gender\": 2, \"id\": 33305, \"name\": \"Nathan Meister\", \"order\": 45}, {\"cast_id\": 67, \"character\": \"Op Center Staff\", \"credit_id\": \"52fe48019251416c750acae3\", \"gender\": 0, \"id\": 1207264, \"name\": \"Gerry Blair\", \"order\": 46}, {\"cast_id\": 68, \"character\": \"Op Center Staff\", \"credit_id\": \"52fe48019251416c750acae7\", \"gender\": 2, \"id\": 33311, \"name\": \"Matthew Chamberlain\", \"order\": 47}, {\"cast_id\": 69, \"character\": \"Op Center Staff\", \"credit_id\": \"52fe48019251416c750acaeb\", \"gender\": 0, \"id\": 1207265, \"name\": \"Paul Yates\", \"order\": 48}, {\"cast_id\": 70, \"character\": \"Op Center Duty Officer\", \"credit_id\": \"52fe48019251416c750acaef\", \"gender\": 0, \"id\": 1207266, \"name\": \"Wray Wilson\", \"order\": 49}, {\"cast_id\": 71, \"character\": \"Op Center Staff\", \"credit_id\": \"52fe48019251416c750acaf3\", \"gender\": 2, \"id\": 54492, \"name\": \"James Gaylyn\", \"order\": 50}, {\"cast_id\": 72, \"character\": \"Dancer\", \"credit_id\": \"52fe48019251416c750acaf7\", \"gender\": 0, \"id\": 1207267, \"name\": \"Melvin Leno Clark III\", \"order\": 51}, {\"cast_id\": 73, \"character\": \"Dancer\", \"credit_id\": \"52fe48019251416c750acafb\", \"gender\": 0, \"id\": 1207268, \"name\": \"Carvon Futrell\", \"order\": 52}, {\"cast_id\": 74, \"character\": \"Dancer\", \"credit_id\": \"52fe48019251416c750acaff\", \"gender\": 0, \"id\": 1207269, \"name\": \"Brandon Jelkes\", \"order\": 53}, {\"cast_id\": 75, \"character\": \"Dancer\", \"credit_id\": \"52fe48019251416c750acb03\", \"gender\": 0, \"id\": 1207270, \"name\": \"Micah Moch\", \"order\": 54}, {\"cast_id\": 76, \"character\": \"Dancer\", \"credit_id\": \"52fe48019251416c750acb07\", \"gender\": 0, \"id\": 1207271, \"name\": \"Hanniyah Muhammad\", \"order\": 55}, {\"cast_id\": 77, \"character\": \"Dancer\", \"credit_id\": \"52fe48019251416c750acb0b\", \"gender\": 0, \"id\": 1207272, \"name\": \"Christopher Nolen\", \"order\": 56}, {\"cast_id\": 78, \"character\": \"Dancer\", \"credit_id\": \"52fe48019251416c750acb0f\", \"gender\": 0, \"id\": 1207273, \"name\": \"Christa Oliver\", \"order\": 57}, {\"cast_id\": 79, \"character\": \"Dancer\", \"credit_id\": \"52fe48019251416c750acb13\", \"gender\": 0, \"id\": 1207274, \"name\": \"April Marie Thomas\", \"order\": 58}, {\"cast_id\": 80, \"character\": \"Dancer\", \"credit_id\": \"52fe48019251416c750acb17\", \"gender\": 0, \"id\": 1207275, \"name\": \"Bravita A. Threatt\", \"order\": 59}, {\"cast_id\": 81, \"character\": \"Mining Chief (uncredited)\", \"credit_id\": \"52fe48019251416c750acb1b\", \"gender\": 0, \"id\": 1207276, \"name\": \"Colin Bleasdale\", \"order\": 60}, {\"cast_id\": 82, \"character\": \"Veteran Miner (uncredited)\", \"credit_id\": \"52fe48019251416c750acb1f\", \"gender\": 0, \"id\": 107969, \"name\": \"Mike Bodnar\", \"order\": 61}, {\"cast_id\": 83, \"character\": \"Richard (uncredited)\", \"credit_id\": \"52fe48019251416c750acb23\", \"gender\": 0, \"id\": 1207278, \"name\": \"Matt Clayton\", \"order\": 62}, {\"cast_id\": 84, \"character\": \"Nav\\'i (uncredited)\", \"credit_id\": \"52fe48019251416c750acb27\", \"gender\": 1, \"id\": 147898, \"name\": \"Nicole Dionne\", \"order\": 63}, {\"cast_id\": 85, \"character\": \"Trooper (uncredited)\", \"credit_id\": \"52fe48019251416c750acb2b\", \"gender\": 0, \"id\": 1207280, \"name\": \"Jamie Harrison\", \"order\": 64}, {\"cast_id\": 86, \"character\": \"Trooper (uncredited)\", \"credit_id\": \"52fe48019251416c750acb2f\", \"gender\": 0, \"id\": 1207281, \"name\": \"Allan Henry\", \"order\": 65}, {\"cast_id\": 87, \"character\": \"Ground Technician (uncredited)\", \"credit_id\": \"52fe48019251416c750acb33\", \"gender\": 2, \"id\": 1207282, \"name\": \"Anthony Ingruber\", \"order\": 66}, {\"cast_id\": 88, \"character\": \"Flight Crew Mechanic (uncredited)\", \"credit_id\": \"52fe48019251416c750acb37\", \"gender\": 0, \"id\": 1207283, \"name\": \"Ashley Jeffery\", \"order\": 67}, {\"cast_id\": 14, \"character\": \"Samson Pilot\", \"credit_id\": \"52fe48009251416c750ac9f9\", \"gender\": 0, \"id\": 98216, \"name\": \"Dean Knowsley\", \"order\": 68}, {\"cast_id\": 89, \"character\": \"Trooper (uncredited)\", \"credit_id\": \"52fe48019251416c750acb3b\", \"gender\": 0, \"id\": 1201399, \"name\": \"Joseph Mika-Hunt\", \"order\": 69}, {\"cast_id\": 90, \"character\": \"Banshee (uncredited)\", \"credit_id\": \"52fe48019251416c750acb3f\", \"gender\": 0, \"id\": 236696, \"name\": \"Terry Notary\", \"order\": 70}, {\"cast_id\": 91, \"character\": \"Soldier (uncredited)\", \"credit_id\": \"52fe48019251416c750acb43\", \"gender\": 0, \"id\": 1207287, \"name\": \"Kai Pantano\", \"order\": 71}, {\"cast_id\": 92, \"character\": \"Blast Technician (uncredited)\", \"credit_id\": \"52fe48019251416c750acb47\", \"gender\": 0, \"id\": 1207288, \"name\": \"Logan Pithyou\", \"order\": 72}, {\"cast_id\": 93, \"character\": \"Vindum Raah (uncredited)\", \"credit_id\": \"52fe48019251416c750acb4b\", \"gender\": 0, \"id\": 1207289, \"name\": \"Stuart Pollock\", \"order\": 73}, {\"cast_id\": 94, \"character\": \"Hero (uncredited)\", \"credit_id\": \"52fe48019251416c750acb4f\", \"gender\": 0, \"id\": 584868, \"name\": \"Raja\", \"order\": 74}, {\"cast_id\": 95, \"character\": \"Ops Centreworker (uncredited)\", \"credit_id\": \"52fe48019251416c750acb53\", \"gender\": 0, \"id\": 1207290, \"name\": \"Gareth Ruck\", \"order\": 75}, {\"cast_id\": 96, \"character\": \"Engineer (uncredited)\", \"credit_id\": \"52fe48019251416c750acb57\", \"gender\": 0, \"id\": 1062463, \"name\": \"Rhian Sheehan\", \"order\": 76}, {\"cast_id\": 97, \"character\": \"Col. Quaritch\\'s Mech Suit (uncredited)\", \"credit_id\": \"52fe48019251416c750acb5b\", \"gender\": 0, \"id\": 60656, \"name\": \"T. J. Storm\", \"order\": 77}, {\"cast_id\": 98, \"character\": \"Female Marine (uncredited)\", \"credit_id\": \"52fe48019251416c750acb5f\", \"gender\": 0, \"id\": 1207291, \"name\": \"Jodie Taylor\", \"order\": 78}, {\"cast_id\": 99, \"character\": \"Ikran Clan Leader (uncredited)\", \"credit_id\": \"52fe48019251416c750acb63\", \"gender\": 1, \"id\": 1186027, \"name\": \"Alicia Vela-Bailey\", \"order\": 79}, {\"cast_id\": 100, \"character\": \"Geologist (uncredited)\", \"credit_id\": \"52fe48019251416c750acb67\", \"gender\": 0, \"id\": 1207292, \"name\": \"Richard Whiteside\", \"order\": 80}, {\"cast_id\": 101, \"character\": \"Na\\'vi (uncredited)\", \"credit_id\": \"52fe48019251416c750acb6b\", \"gender\": 0, \"id\": 103259, \"name\": \"Nikie Zambo\", \"order\": 81}, {\"cast_id\": 102, \"character\": \"Ambient Room Tech / Troupe\", \"credit_id\": \"52fe48019251416c750acb6f\", \"gender\": 1, \"id\": 42286, \"name\": \"Julene Renee\", \"order\": 82}]'" ] }, "execution_count": 21, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movies['cast'][0]" ] }, { "cell_type": "code", "execution_count": 22, "id": "919178f5", "metadata": {}, "outputs": [], "source": [ "def convert3(obj):\n", " l=[]\n", " counter=0\n", " for i in ast.literal_eval(obj):\n", " if counter!=3:\n", " l.append(i['name'])\n", " counter+=1\n", " else:\n", " break\n", " \n", " return l\n" ] }, { "cell_type": "code", "execution_count": 23, "id": "d26d52f8", "metadata": {}, "outputs": [], "source": [ "movies['cast']=movies['cast'].apply(convert3)" ] }, { "cell_type": "code", "execution_count": 24, "id": "13536b8b", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'[{\"credit_id\": \"52fe48009251416c750aca23\", \"department\": \"Editing\", \"gender\": 0, \"id\": 1721, \"job\": \"Editor\", \"name\": \"Stephen E. Rivkin\"}, {\"credit_id\": \"539c47ecc3a36810e3001f87\", \"department\": \"Art\", \"gender\": 2, \"id\": 496, \"job\": \"Production Design\", \"name\": \"Rick Carter\"}, {\"credit_id\": \"54491c89c3a3680fb4001cf7\", \"department\": \"Sound\", \"gender\": 0, \"id\": 900, \"job\": \"Sound Designer\", \"name\": \"Christopher Boyes\"}, {\"credit_id\": \"54491cb70e0a267480001bd0\", \"department\": \"Sound\", \"gender\": 0, \"id\": 900, \"job\": \"Supervising Sound Editor\", \"name\": \"Christopher Boyes\"}, {\"credit_id\": \"539c4a4cc3a36810c9002101\", \"department\": \"Production\", \"gender\": 1, \"id\": 1262, \"job\": \"Casting\", \"name\": \"Mali Finn\"}, {\"credit_id\": \"5544ee3b925141499f0008fc\", \"department\": \"Sound\", \"gender\": 2, \"id\": 1729, \"job\": \"Original Music Composer\", \"name\": \"James Horner\"}, {\"credit_id\": \"52fe48009251416c750ac9c3\", \"department\": \"Directing\", \"gender\": 2, \"id\": 2710, \"job\": \"Director\", \"name\": \"James Cameron\"}, {\"credit_id\": \"52fe48009251416c750ac9d9\", \"department\": \"Writing\", \"gender\": 2, \"id\": 2710, \"job\": \"Writer\", \"name\": \"James Cameron\"}, {\"credit_id\": \"52fe48009251416c750aca17\", \"department\": \"Editing\", \"gender\": 2, \"id\": 2710, \"job\": \"Editor\", \"name\": \"James Cameron\"}, {\"credit_id\": \"52fe48009251416c750aca29\", \"department\": \"Production\", \"gender\": 2, \"id\": 2710, \"job\": \"Producer\", \"name\": \"James Cameron\"}, {\"credit_id\": \"52fe48009251416c750aca3f\", \"department\": \"Writing\", \"gender\": 2, \"id\": 2710, \"job\": \"Screenplay\", \"name\": \"James Cameron\"}, {\"credit_id\": \"539c4987c3a36810ba0021a4\", \"department\": \"Art\", \"gender\": 2, \"id\": 7236, \"job\": \"Art Direction\", \"name\": \"Andrew Menzies\"}, {\"credit_id\": \"549598c3c3a3686ae9004383\", \"department\": \"Visual Effects\", \"gender\": 0, \"id\": 6690, \"job\": \"Visual Effects Producer\", \"name\": \"Jill Brooks\"}, {\"credit_id\": \"52fe48009251416c750aca4b\", \"department\": \"Production\", \"gender\": 1, \"id\": 6347, \"job\": \"Casting\", \"name\": \"Margery Simkin\"}, {\"credit_id\": \"570b6f419251417da70032fe\", \"department\": \"Art\", \"gender\": 2, \"id\": 6878, \"job\": \"Supervising Art Director\", \"name\": \"Kevin Ishioka\"}, {\"credit_id\": \"5495a0fac3a3686ae9004468\", \"department\": \"Sound\", \"gender\": 0, \"id\": 6883, \"job\": \"Music Editor\", \"name\": \"Dick Bernstein\"}, {\"credit_id\": \"54959706c3a3686af3003e81\", \"department\": \"Sound\", \"gender\": 0, \"id\": 8159, \"job\": \"Sound Effects Editor\", \"name\": \"Shannon Mills\"}, {\"credit_id\": \"54491d58c3a3680fb1001ccb\", \"department\": \"Sound\", \"gender\": 0, \"id\": 8160, \"job\": \"Foley\", \"name\": \"Dennie Thorpe\"}, {\"credit_id\": \"54491d6cc3a3680fa5001b2c\", \"department\": \"Sound\", \"gender\": 0, \"id\": 8163, \"job\": \"Foley\", \"name\": \"Jana Vance\"}, {\"credit_id\": \"52fe48009251416c750aca57\", \"department\": \"Costume & Make-Up\", \"gender\": 1, \"id\": 8527, \"job\": \"Costume Design\", \"name\": \"Deborah Lynn Scott\"}, {\"credit_id\": \"52fe48009251416c750aca2f\", \"department\": \"Production\", \"gender\": 2, \"id\": 8529, \"job\": \"Producer\", \"name\": \"Jon Landau\"}, {\"credit_id\": \"539c4937c3a36810ba002194\", \"department\": \"Art\", \"gender\": 0, \"id\": 9618, \"job\": \"Art Direction\", \"name\": \"Sean Haworth\"}, {\"credit_id\": \"539c49b6c3a36810c10020e6\", \"department\": \"Art\", \"gender\": 1, \"id\": 12653, \"job\": \"Set Decoration\", \"name\": \"Kim Sinclair\"}, {\"credit_id\": \"570b6f2f9251413a0e00020d\", \"department\": \"Art\", \"gender\": 1, \"id\": 12653, \"job\": \"Supervising Art Director\", \"name\": \"Kim Sinclair\"}, {\"credit_id\": \"54491a6c0e0a26748c001b19\", \"department\": \"Art\", \"gender\": 2, \"id\": 14350, \"job\": \"Set Designer\", \"name\": \"Richard F. Mays\"}, {\"credit_id\": \"56928cf4c3a3684cff0025c4\", \"department\": \"Production\", \"gender\": 1, \"id\": 20294, \"job\": \"Executive Producer\", \"name\": \"Laeta Kalogridis\"}, {\"credit_id\": \"52fe48009251416c750aca51\", \"department\": \"Costume & Make-Up\", \"gender\": 0, \"id\": 17675, \"job\": \"Costume Design\", \"name\": \"Mayes C. Rubeo\"}, {\"credit_id\": \"52fe48009251416c750aca11\", \"department\": \"Camera\", \"gender\": 2, \"id\": 18265, \"job\": \"Director of Photography\", \"name\": \"Mauro Fiore\"}, {\"credit_id\": \"5449194d0e0a26748f001b39\", \"department\": \"Art\", \"gender\": 0, \"id\": 42281, \"job\": \"Set Designer\", \"name\": \"Scott Herbertson\"}, {\"credit_id\": \"52fe48009251416c750aca05\", \"department\": \"Crew\", \"gender\": 0, \"id\": 42288, \"job\": \"Stunts\", \"name\": \"Woody Schultz\"}, {\"credit_id\": \"5592aefb92514152de0010f5\", \"department\": \"Costume & Make-Up\", \"gender\": 0, \"id\": 29067, \"job\": \"Makeup Artist\", \"name\": \"Linda DeVetta\"}, {\"credit_id\": \"5592afa492514152de00112c\", \"department\": \"Costume & Make-Up\", \"gender\": 0, \"id\": 29067, \"job\": \"Hairstylist\", \"name\": \"Linda DeVetta\"}, {\"credit_id\": \"54959ed592514130fc002e5d\", \"department\": \"Camera\", \"gender\": 2, \"id\": 33302, \"job\": \"Camera Operator\", \"name\": \"Richard Bluck\"}, {\"credit_id\": \"539c4891c3a36810ba002147\", \"department\": \"Art\", \"gender\": 2, \"id\": 33303, \"job\": \"Art Direction\", \"name\": \"Simon Bright\"}, {\"credit_id\": \"54959c069251417a81001f3a\", \"department\": \"Visual Effects\", \"gender\": 0, \"id\": 113145, \"job\": \"Visual Effects Supervisor\", \"name\": \"Richard Martin\"}, {\"credit_id\": \"54959a0dc3a3680ff5002c8d\", \"department\": \"Crew\", \"gender\": 2, \"id\": 58188, \"job\": \"Visual Effects Editor\", \"name\": \"Steve R. Moore\"}, {\"credit_id\": \"52fe48009251416c750aca1d\", \"department\": \"Editing\", \"gender\": 2, \"id\": 58871, \"job\": \"Editor\", \"name\": \"John Refoua\"}, {\"credit_id\": \"54491a4dc3a3680fc30018ca\", \"department\": \"Art\", \"gender\": 0, \"id\": 92359, \"job\": \"Set Designer\", \"name\": \"Karl J. Martin\"}, {\"credit_id\": \"52fe48009251416c750aca35\", \"department\": \"Camera\", \"gender\": 1, \"id\": 72201, \"job\": \"Director of Photography\", \"name\": \"Chiling Lin\"}, {\"credit_id\": \"52fe48009251416c750ac9ff\", \"department\": \"Crew\", \"gender\": 0, \"id\": 89714, \"job\": \"Stunts\", \"name\": \"Ilram Choi\"}, {\"credit_id\": \"54959c529251416e2b004394\", \"department\": \"Visual Effects\", \"gender\": 2, \"id\": 93214, \"job\": \"Visual Effects Supervisor\", \"name\": \"Steven Quale\"}, {\"credit_id\": \"54491edf0e0a267489001c37\", \"department\": \"Crew\", \"gender\": 1, \"id\": 122607, \"job\": \"Dialect Coach\", \"name\": \"Carla Meyer\"}, {\"credit_id\": \"539c485bc3a368653d001a3a\", \"department\": \"Art\", \"gender\": 2, \"id\": 132585, \"job\": \"Art Direction\", \"name\": \"Nick Bassett\"}, {\"credit_id\": \"539c4903c3a368653d001a74\", \"department\": \"Art\", \"gender\": 0, \"id\": 132596, \"job\": \"Art Direction\", \"name\": \"Jill Cormack\"}, {\"credit_id\": \"539c4967c3a368653d001a94\", \"department\": \"Art\", \"gender\": 0, \"id\": 132604, \"job\": \"Art Direction\", \"name\": \"Andy McLaren\"}, {\"credit_id\": \"52fe48009251416c750aca45\", \"department\": \"Crew\", \"gender\": 0, \"id\": 236696, \"job\": \"Motion Capture Artist\", \"name\": \"Terry Notary\"}, {\"credit_id\": \"54959e02c3a3680fc60027d2\", \"department\": \"Crew\", \"gender\": 2, \"id\": 956198, \"job\": \"Stunt Coordinator\", \"name\": \"Garrett Warren\"}, {\"credit_id\": \"54959ca3c3a3686ae300438c\", \"department\": \"Visual Effects\", \"gender\": 2, \"id\": 957874, \"job\": \"Visual Effects Supervisor\", \"name\": \"Jonathan Rothbart\"}, {\"credit_id\": \"570b6f519251412c74001b2f\", \"department\": \"Art\", \"gender\": 0, \"id\": 957889, \"job\": \"Supervising Art Director\", \"name\": \"Stefan Dechant\"}, {\"credit_id\": \"570b6f62c3a3680b77007460\", \"department\": \"Art\", \"gender\": 2, \"id\": 959555, \"job\": \"Supervising Art Director\", \"name\": \"Todd Cherniawsky\"}, {\"credit_id\": \"539c4a3ac3a36810da0021cc\", \"department\": \"Production\", \"gender\": 0, \"id\": 1016177, \"job\": \"Casting\", \"name\": \"Miranda Rivers\"}, {\"credit_id\": \"539c482cc3a36810c1002062\", \"department\": \"Art\", \"gender\": 0, \"id\": 1032536, \"job\": \"Production Design\", \"name\": \"Robert Stromberg\"}, {\"credit_id\": \"539c4b65c3a36810c9002125\", \"department\": \"Costume & Make-Up\", \"gender\": 2, \"id\": 1071680, \"job\": \"Costume Design\", \"name\": \"John Harding\"}, {\"credit_id\": \"54959e6692514130fc002e4e\", \"department\": \"Camera\", \"gender\": 0, \"id\": 1177364, \"job\": \"Steadicam Operator\", \"name\": \"Roberto De Angelis\"}, {\"credit_id\": \"539c49f1c3a368653d001aac\", \"department\": \"Costume & Make-Up\", \"gender\": 2, \"id\": 1202850, \"job\": \"Makeup Department Head\", \"name\": \"Mike Smithson\"}, {\"credit_id\": \"5495999ec3a3686ae100460c\", \"department\": \"Visual Effects\", \"gender\": 0, \"id\": 1204668, \"job\": \"Visual Effects Producer\", \"name\": \"Alain Lalanne\"}, {\"credit_id\": \"54959cdfc3a3681153002729\", \"department\": \"Visual Effects\", \"gender\": 0, \"id\": 1206410, \"job\": \"Visual Effects Supervisor\", \"name\": \"Lucas Salton\"}, {\"credit_id\": \"549596239251417a81001eae\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1234266, \"job\": \"Post Production Supervisor\", \"name\": \"Janace Tashjian\"}, {\"credit_id\": \"54959c859251416e1e003efe\", \"department\": \"Visual Effects\", \"gender\": 0, \"id\": 1271932, \"job\": \"Visual Effects Supervisor\", \"name\": \"Stephen Rosenbaum\"}, {\"credit_id\": \"5592af28c3a368775a00105f\", \"department\": \"Costume & Make-Up\", \"gender\": 0, \"id\": 1310064, \"job\": \"Makeup Artist\", \"name\": \"Frankie Karena\"}, {\"credit_id\": \"539c4adfc3a36810e300203b\", \"department\": \"Costume & Make-Up\", \"gender\": 1, \"id\": 1319844, \"job\": \"Costume Supervisor\", \"name\": \"Lisa Lovaas\"}, {\"credit_id\": \"54959b579251416e2b004371\", \"department\": \"Visual Effects\", \"gender\": 0, \"id\": 1327028, \"job\": \"Visual Effects Supervisor\", \"name\": \"Jonathan Fawkner\"}, {\"credit_id\": \"539c48a7c3a36810b5001fa7\", \"department\": \"Art\", \"gender\": 0, \"id\": 1330561, \"job\": \"Art Direction\", \"name\": \"Robert Bavin\"}, {\"credit_id\": \"539c4a71c3a36810da0021e0\", \"department\": \"Costume & Make-Up\", \"gender\": 0, \"id\": 1330567, \"job\": \"Costume Supervisor\", \"name\": \"Anthony Almaraz\"}, {\"credit_id\": \"539c4a8ac3a36810ba0021e4\", \"department\": \"Costume & Make-Up\", \"gender\": 0, \"id\": 1330570, \"job\": \"Costume Supervisor\", \"name\": \"Carolyn M. Fenton\"}, {\"credit_id\": \"539c4ab6c3a36810da0021f0\", \"department\": \"Costume & Make-Up\", \"gender\": 0, \"id\": 1330574, \"job\": \"Costume Supervisor\", \"name\": \"Beth Koenigsberg\"}, {\"credit_id\": \"54491ab70e0a267480001ba2\", \"department\": \"Art\", \"gender\": 0, \"id\": 1336191, \"job\": \"Set Designer\", \"name\": \"Sam Page\"}, {\"credit_id\": \"544919d9c3a3680fc30018bd\", \"department\": \"Art\", \"gender\": 0, \"id\": 1339441, \"job\": \"Set Designer\", \"name\": \"Tex Kadonaga\"}, {\"credit_id\": \"54491cf50e0a267483001b0c\", \"department\": \"Editing\", \"gender\": 0, \"id\": 1352422, \"job\": \"Dialogue Editor\", \"name\": \"Kim Foscato\"}, {\"credit_id\": \"544919f40e0a26748c001b09\", \"department\": \"Art\", \"gender\": 0, \"id\": 1352962, \"job\": \"Set Designer\", \"name\": \"Tammy S. Lee\"}, {\"credit_id\": \"5495a115c3a3680ff5002d71\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1357070, \"job\": \"Transportation Coordinator\", \"name\": \"Denny Caira\"}, {\"credit_id\": \"5495a12f92514130fc002e94\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1357071, \"job\": \"Transportation Coordinator\", \"name\": \"James Waitkus\"}, {\"credit_id\": \"5495976fc3a36811530026b0\", \"department\": \"Sound\", \"gender\": 0, \"id\": 1360103, \"job\": \"Supervising Sound Editor\", \"name\": \"Addison Teague\"}, {\"credit_id\": \"54491837c3a3680fb1001c5a\", \"department\": \"Art\", \"gender\": 2, \"id\": 1376887, \"job\": \"Set Designer\", \"name\": \"C. Scott Baker\"}, {\"credit_id\": \"54491878c3a3680fb4001c9d\", \"department\": \"Art\", \"gender\": 0, \"id\": 1376888, \"job\": \"Set Designer\", \"name\": \"Luke Caska\"}, {\"credit_id\": \"544918dac3a3680fa5001ae0\", \"department\": \"Art\", \"gender\": 0, \"id\": 1376889, \"job\": \"Set Designer\", \"name\": \"David Chow\"}, {\"credit_id\": \"544919110e0a267486001b68\", \"department\": \"Art\", \"gender\": 0, \"id\": 1376890, \"job\": \"Set Designer\", \"name\": \"Jonathan Dyer\"}, {\"credit_id\": \"54491967c3a3680faa001b5e\", \"department\": \"Art\", \"gender\": 0, \"id\": 1376891, \"job\": \"Set Designer\", \"name\": \"Joseph Hiura\"}, {\"credit_id\": \"54491997c3a3680fb1001c8a\", \"department\": \"Art\", \"gender\": 0, \"id\": 1376892, \"job\": \"Art Department Coordinator\", \"name\": \"Rebecca Jellie\"}, {\"credit_id\": \"544919ba0e0a26748f001b42\", \"department\": \"Art\", \"gender\": 0, \"id\": 1376893, \"job\": \"Set Designer\", \"name\": \"Robert Andrew Johnson\"}, {\"credit_id\": \"54491b1dc3a3680faa001b8c\", \"department\": \"Art\", \"gender\": 0, \"id\": 1376895, \"job\": \"Assistant Art Director\", \"name\": \"Mike Stassi\"}, {\"credit_id\": \"54491b79c3a3680fbb001826\", \"department\": \"Art\", \"gender\": 0, \"id\": 1376897, \"job\": \"Construction Coordinator\", \"name\": \"John Villarino\"}, {\"credit_id\": \"54491baec3a3680fb4001ce6\", \"department\": \"Art\", \"gender\": 2, \"id\": 1376898, \"job\": \"Assistant Art Director\", \"name\": \"Jeffrey Wisniewski\"}, {\"credit_id\": \"54491d2fc3a3680fb4001d07\", \"department\": \"Editing\", \"gender\": 0, \"id\": 1376899, \"job\": \"Dialogue Editor\", \"name\": \"Cheryl Nardi\"}, {\"credit_id\": \"54491d86c3a3680fa5001b2f\", \"department\": \"Editing\", \"gender\": 0, \"id\": 1376901, \"job\": \"Dialogue Editor\", \"name\": \"Marshall Winn\"}, {\"credit_id\": \"54491d9dc3a3680faa001bb0\", \"department\": \"Sound\", \"gender\": 0, \"id\": 1376902, \"job\": \"Supervising Sound Editor\", \"name\": \"Gwendolyn Yates Whittle\"}, {\"credit_id\": \"54491dc10e0a267486001bce\", \"department\": \"Sound\", \"gender\": 0, \"id\": 1376903, \"job\": \"Sound Re-Recording Mixer\", \"name\": \"William Stein\"}, {\"credit_id\": \"54491f500e0a26747c001c07\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1376909, \"job\": \"Choreographer\", \"name\": \"Lula Washington\"}, {\"credit_id\": \"549599239251412c4e002a2e\", \"department\": \"Visual Effects\", \"gender\": 0, \"id\": 1391692, \"job\": \"Visual Effects Producer\", \"name\": \"Chris Del Conte\"}, {\"credit_id\": \"54959d54c3a36831b8001d9a\", \"department\": \"Visual Effects\", \"gender\": 2, \"id\": 1391695, \"job\": \"Visual Effects Supervisor\", \"name\": \"R. Christopher White\"}, {\"credit_id\": \"54959bdf9251412c4e002a66\", \"department\": \"Visual Effects\", \"gender\": 0, \"id\": 1394070, \"job\": \"Visual Effects Supervisor\", \"name\": \"Dan Lemmon\"}, {\"credit_id\": \"5495971d92514132ed002922\", \"department\": \"Sound\", \"gender\": 0, \"id\": 1394129, \"job\": \"Sound Effects Editor\", \"name\": \"Tim Nielsen\"}, {\"credit_id\": \"5592b25792514152cc0011aa\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1394286, \"job\": \"CG Supervisor\", \"name\": \"Michael Mulholland\"}, {\"credit_id\": \"54959a329251416e2b004355\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1394750, \"job\": \"Visual Effects Editor\", \"name\": \"Thomas Nittmann\"}, {\"credit_id\": \"54959d6dc3a3686ae9004401\", \"department\": \"Visual Effects\", \"gender\": 0, \"id\": 1394755, \"job\": \"Visual Effects Supervisor\", \"name\": \"Edson Williams\"}, {\"credit_id\": \"5495a08fc3a3686ae300441c\", \"department\": \"Editing\", \"gender\": 0, \"id\": 1394953, \"job\": \"Digital Intermediate\", \"name\": \"Christine Carr\"}, {\"credit_id\": \"55402d659251413d6d000249\", \"department\": \"Visual Effects\", \"gender\": 0, \"id\": 1395269, \"job\": \"Visual Effects Supervisor\", \"name\": \"John Bruno\"}, {\"credit_id\": \"54959e7b9251416e1e003f3e\", \"department\": \"Camera\", \"gender\": 0, \"id\": 1398970, \"job\": \"Steadicam Operator\", \"name\": \"David Emmerichs\"}, {\"credit_id\": \"54959734c3a3686ae10045e0\", \"department\": \"Sound\", \"gender\": 0, \"id\": 1400906, \"job\": \"Sound Effects Editor\", \"name\": \"Christopher Scarabosio\"}, {\"credit_id\": \"549595dd92514130fc002d79\", \"department\": \"Production\", \"gender\": 0, \"id\": 1401784, \"job\": \"Production Supervisor\", \"name\": \"Jennifer Teves\"}, {\"credit_id\": \"549596009251413af70028cc\", \"department\": \"Production\", \"gender\": 0, \"id\": 1401785, \"job\": \"Production Manager\", \"name\": \"Brigitte Yorke\"}, {\"credit_id\": \"549596e892514130fc002d99\", \"department\": \"Sound\", \"gender\": 0, \"id\": 1401786, \"job\": \"Sound Effects Editor\", \"name\": \"Ken Fischer\"}, {\"credit_id\": \"549598229251412c4e002a1c\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1401787, \"job\": \"Special Effects Coordinator\", \"name\": \"Iain Hutton\"}, {\"credit_id\": \"549598349251416e2b00432b\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1401788, \"job\": \"Special Effects Coordinator\", \"name\": \"Steve Ingram\"}, {\"credit_id\": \"54959905c3a3686ae3004324\", \"department\": \"Visual Effects\", \"gender\": 0, \"id\": 1401789, \"job\": \"Visual Effects Producer\", \"name\": \"Joyce Cox\"}, {\"credit_id\": \"5495994b92514132ed002951\", \"department\": \"Visual Effects\", \"gender\": 0, \"id\": 1401790, \"job\": \"Visual Effects Producer\", \"name\": \"Jenny Foster\"}, {\"credit_id\": \"549599cbc3a3686ae1004613\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1401791, \"job\": \"Visual Effects Editor\", \"name\": \"Christopher Marino\"}, {\"credit_id\": \"549599f2c3a3686ae100461e\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1401792, \"job\": \"Visual Effects Editor\", \"name\": \"Jim Milton\"}, {\"credit_id\": \"54959a51c3a3686af3003eb5\", \"department\": \"Visual Effects\", \"gender\": 0, \"id\": 1401793, \"job\": \"Visual Effects Producer\", \"name\": \"Cyndi Ochs\"}, {\"credit_id\": \"54959a7cc3a36811530026f4\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1401794, \"job\": \"Visual Effects Editor\", \"name\": \"Lucas Putnam\"}, {\"credit_id\": \"54959b91c3a3680ff5002cb4\", \"department\": \"Visual Effects\", \"gender\": 0, \"id\": 1401795, \"job\": \"Visual Effects Supervisor\", \"name\": \"Anthony \\'Max\\' Ivins\"}, {\"credit_id\": \"54959bb69251412c4e002a5f\", \"department\": \"Visual Effects\", \"gender\": 0, \"id\": 1401796, \"job\": \"Visual Effects Supervisor\", \"name\": \"John Knoll\"}, {\"credit_id\": \"54959cbbc3a3686ae3004391\", \"department\": \"Visual Effects\", \"gender\": 2, \"id\": 1401799, \"job\": \"Visual Effects Supervisor\", \"name\": \"Eric Saindon\"}, {\"credit_id\": \"54959d06c3a3686ae90043f6\", \"department\": \"Visual Effects\", \"gender\": 0, \"id\": 1401800, \"job\": \"Visual Effects Supervisor\", \"name\": \"Wayne Stables\"}, {\"credit_id\": \"54959d259251416e1e003f11\", \"department\": \"Visual Effects\", \"gender\": 0, \"id\": 1401801, \"job\": \"Visual Effects Supervisor\", \"name\": \"David Stinnett\"}, {\"credit_id\": \"54959db49251413af7002975\", \"department\": \"Visual Effects\", \"gender\": 0, \"id\": 1401803, \"job\": \"Visual Effects Supervisor\", \"name\": \"Guy Williams\"}, {\"credit_id\": \"54959de4c3a3681153002750\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1401804, \"job\": \"Stunt Coordinator\", \"name\": \"Stuart Thorp\"}, {\"credit_id\": \"54959ef2c3a3680fc60027f2\", \"department\": \"Lighting\", \"gender\": 0, \"id\": 1401805, \"job\": \"Best Boy Electric\", \"name\": \"Giles Coburn\"}, {\"credit_id\": \"54959f07c3a3680fc60027f9\", \"department\": \"Camera\", \"gender\": 2, \"id\": 1401806, \"job\": \"Still Photographer\", \"name\": \"Mark Fellman\"}, {\"credit_id\": \"54959f47c3a3681153002774\", \"department\": \"Lighting\", \"gender\": 0, \"id\": 1401807, \"job\": \"Lighting Technician\", \"name\": \"Scott Sprague\"}, {\"credit_id\": \"54959f8cc3a36831b8001df2\", \"department\": \"Visual Effects\", \"gender\": 0, \"id\": 1401808, \"job\": \"Animation Director\", \"name\": \"Jeremy Hollobon\"}, {\"credit_id\": \"54959fa0c3a36831b8001dfb\", \"department\": \"Visual Effects\", \"gender\": 0, \"id\": 1401809, \"job\": \"Animation Director\", \"name\": \"Orlando Meunier\"}, {\"credit_id\": \"54959fb6c3a3686af3003f54\", \"department\": \"Visual Effects\", \"gender\": 0, \"id\": 1401810, \"job\": \"Animation Director\", \"name\": \"Taisuke Tanimura\"}, {\"credit_id\": \"54959fd2c3a36831b8001e02\", \"department\": \"Costume & Make-Up\", \"gender\": 0, \"id\": 1401812, \"job\": \"Set Costumer\", \"name\": \"Lilia Mishel Acevedo\"}, {\"credit_id\": \"54959ff9c3a3686ae300440c\", \"department\": \"Costume & Make-Up\", \"gender\": 0, \"id\": 1401814, \"job\": \"Set Costumer\", \"name\": \"Alejandro M. Hernandez\"}, {\"credit_id\": \"5495a0ddc3a3686ae10046fe\", \"department\": \"Editing\", \"gender\": 0, \"id\": 1401815, \"job\": \"Digital Intermediate\", \"name\": \"Marvin Hall\"}, {\"credit_id\": \"5495a1f7c3a3686ae3004443\", \"department\": \"Production\", \"gender\": 0, \"id\": 1401816, \"job\": \"Publicist\", \"name\": \"Judy Alley\"}, {\"credit_id\": \"5592b29fc3a36869d100002f\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1418381, \"job\": \"CG Supervisor\", \"name\": \"Mike Perry\"}, {\"credit_id\": \"5592b23a9251415df8001081\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1426854, \"job\": \"CG Supervisor\", \"name\": \"Andrew Morley\"}, {\"credit_id\": \"55491e1192514104c40002d8\", \"department\": \"Art\", \"gender\": 0, \"id\": 1438901, \"job\": \"Conceptual Design\", \"name\": \"Seth Engstrom\"}, {\"credit_id\": \"5525d5809251417276002b06\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1447362, \"job\": \"Visual Effects Art Director\", \"name\": \"Eric Oliver\"}, {\"credit_id\": \"554427ca925141586500312a\", \"department\": \"Visual Effects\", \"gender\": 0, \"id\": 1447503, \"job\": \"Modeling\", \"name\": \"Matsune Suzuki\"}, {\"credit_id\": \"551906889251415aab001c88\", \"department\": \"Art\", \"gender\": 0, \"id\": 1447524, \"job\": \"Art Department Manager\", \"name\": \"Paul Tobin\"}, {\"credit_id\": \"5592af8492514152cc0010de\", \"department\": \"Costume & Make-Up\", \"gender\": 0, \"id\": 1452643, \"job\": \"Hairstylist\", \"name\": \"Roxane Griffin\"}, {\"credit_id\": \"553d3c109251415852001318\", \"department\": \"Lighting\", \"gender\": 0, \"id\": 1453938, \"job\": \"Lighting Artist\", \"name\": \"Arun Ram-Mohan\"}, {\"credit_id\": \"5592af4692514152d5001355\", \"department\": \"Costume & Make-Up\", \"gender\": 0, \"id\": 1457305, \"job\": \"Makeup Artist\", \"name\": \"Georgia Lockhart-Adams\"}, {\"credit_id\": \"5592b2eac3a36877470012a5\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1466035, \"job\": \"CG Supervisor\", \"name\": \"Thrain Shadbolt\"}, {\"credit_id\": \"5592b032c3a36877450015f1\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1483220, \"job\": \"CG Supervisor\", \"name\": \"Brad Alexander\"}, {\"credit_id\": \"5592b05592514152d80012f6\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1483221, \"job\": \"CG Supervisor\", \"name\": \"Shadi Almassizadeh\"}, {\"credit_id\": \"5592b090c3a36877570010b5\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1483222, \"job\": \"CG Supervisor\", \"name\": \"Simon Clutterbuck\"}, {\"credit_id\": \"5592b0dbc3a368774b00112c\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1483223, \"job\": \"CG Supervisor\", \"name\": \"Graeme Demmocks\"}, {\"credit_id\": \"5592b0fe92514152db0010c1\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1483224, \"job\": \"CG Supervisor\", \"name\": \"Adrian Fernandes\"}, {\"credit_id\": \"5592b11f9251415df8001059\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1483225, \"job\": \"CG Supervisor\", \"name\": \"Mitch Gates\"}, {\"credit_id\": \"5592b15dc3a3687745001645\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1483226, \"job\": \"CG Supervisor\", \"name\": \"Jerry Kung\"}, {\"credit_id\": \"5592b18e925141645a0004ae\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1483227, \"job\": \"CG Supervisor\", \"name\": \"Andy Lomas\"}, {\"credit_id\": \"5592b1bfc3a368775d0010e7\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1483228, \"job\": \"CG Supervisor\", \"name\": \"Sebastian Marino\"}, {\"credit_id\": \"5592b2049251415df8001078\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1483229, \"job\": \"CG Supervisor\", \"name\": \"Matthias Menz\"}, {\"credit_id\": \"5592b27b92514152d800136a\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1483230, \"job\": \"CG Supervisor\", \"name\": \"Sergei Nevshupov\"}, {\"credit_id\": \"5592b2c3c3a36869e800003c\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1483231, \"job\": \"CG Supervisor\", \"name\": \"Philippe Rebours\"}, {\"credit_id\": \"5592b317c3a36877470012af\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1483232, \"job\": \"CG Supervisor\", \"name\": \"Michael Takarangi\"}, {\"credit_id\": \"5592b345c3a36877470012bb\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1483233, \"job\": \"CG Supervisor\", \"name\": \"David Weitzberg\"}, {\"credit_id\": \"5592b37cc3a368775100113b\", \"department\": \"Crew\", \"gender\": 0, \"id\": 1483234, \"job\": \"CG Supervisor\", \"name\": \"Ben White\"}, {\"credit_id\": \"573c8e2f9251413f5d000094\", \"department\": \"Crew\", \"gender\": 1, \"id\": 1621932, \"job\": \"Stunts\", \"name\": \"Min Windle\"}]'" ] }, "execution_count": 24, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movies['crew'][0]" ] }, { "cell_type": "code", "execution_count": 25, "id": "f1b5948a", "metadata": {}, "outputs": [], "source": [ "def fetchdirect(obj):\n", " l=[]\n", " \n", " for i in ast.literal_eval(obj):\n", " if i['job']=='Director':\n", " l.append(i['name'])\n", " \n", " break\n", " \n", " return l" ] }, { "cell_type": "code", "execution_count": 26, "id": "12a8ef59", "metadata": {}, "outputs": [], "source": [ "movies['crew']=movies['crew'].apply(fetchdirect)" ] }, { "cell_type": "code", "execution_count": 27, "id": "bbeef8aa", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'In the 22nd century, a paraplegic Marine is dispatched to the moon Pandora on a unique mission, but becomes torn between following orders and protecting an alien civilization.'" ] }, "execution_count": 27, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movies['overview'][0]" ] }, { "cell_type": "code", "execution_count": 28, "id": "d27ef4d2", "metadata": {}, "outputs": [], "source": [ "movies['overview']=movies['overview'].apply(lambda x:x.split())" ] }, { "cell_type": "code", "execution_count": 29, "id": "b3bd0204", "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_idtitleoverviewkeywordsgenrescastcrew
019995Avatar[In, the, 22nd, century,, a, paraplegic, Marin...[culture clash, future, space war, space colon...[Action, Adventure, Fantasy, Science Fiction][Sam Worthington, Zoe Saldana, Sigourney Weaver][James Cameron]
1285Pirates of the Caribbean: At World's End[Captain, Barbossa,, long, believed, to, be, d...[ocean, drug abuse, exotic island, east india ...[Adventure, Fantasy, Action][Johnny Depp, Orlando Bloom, Keira Knightley][Gore Verbinski]
2206647Spectre[A, cryptic, message, from, Bond’s, past, send...[spy, based on novel, secret agent, sequel, mi...[Action, Adventure, Crime][Daniel Craig, Christoph Waltz, Léa Seydoux][Sam Mendes]
349026The Dark Knight Rises[Following, the, death, of, District, Attorney...[dc comics, crime fighter, terrorist, secret i...[Action, Crime, Drama, Thriller][Christian Bale, Michael Caine, Gary Oldman][Christopher Nolan]
449529John Carter[John, Carter, is, a, war-weary,, former, mili...[based on novel, mars, medallion, space travel...[Action, Adventure, Science Fiction][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", " 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", " 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", " cast crew \n", "0 [Sam Worthington, Zoe Saldana, Sigourney Weaver] [James Cameron] \n", "1 [Johnny Depp, Orlando Bloom, Keira Knightley] [Gore Verbinski] \n", "2 [Daniel Craig, Christoph Waltz, Léa Seydoux] [Sam Mendes] \n", "3 [Christian Bale, Michael Caine, Gary Oldman] [Christopher Nolan] \n", "4 [Taylor Kitsch, Lynn Collins, Samantha Morton] [Andrew Stanton] " ] }, "execution_count": 29, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movies.head()" ] }, { "cell_type": "code", "execution_count": 30, "id": "22fba3e8", "metadata": {}, "outputs": [], "source": [ "#for remove space \n", "movies['genres']=movies['genres'].apply(lambda x:[i.replace(\" \",\"\") for i in x])" ] }, { "cell_type": "code", "execution_count": 31, "id": "ad9d3f78", "metadata": {}, "outputs": [], "source": [ "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])" ] }, { "cell_type": "code", "execution_count": 32, "id": "0ef7acd4", "metadata": {}, "outputs": [], "source": [ "movies['tags']=movies['overview']+movies['genres']+movies['keywords']+movies['cast']+movies['crew']" ] }, { "cell_type": "code", "execution_count": 33, "id": "fb4e5edc", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
movie_idtitleoverviewkeywordsgenrescastcrewtags
019995Avatar[In, the, 22nd, century,, a, paraplegic, Marin...[cultureclash, future, spacewar, spacecolony, ...[Action, Adventure, Fantasy, ScienceFiction][SamWorthington, ZoeSaldana, SigourneyWeaver][JamesCameron][In, the, 22nd, century,, a, paraplegic, Marin...
1285Pirates of the Caribbean: At World's End[Captain, Barbossa,, long, believed, to, be, d...[ocean, drugabuse, exoticisland, eastindiatrad...[Adventure, Fantasy, Action][JohnnyDepp, OrlandoBloom, KeiraKnightley][GoreVerbinski][Captain, Barbossa,, long, believed, to, be, d...
2206647Spectre[A, cryptic, message, from, Bond’s, past, send...[spy, basedonnovel, secretagent, sequel, mi6, ...[Action, Adventure, Crime][DanielCraig, ChristophWaltz, LéaSeydoux][SamMendes][A, cryptic, message, from, Bond’s, past, send...
349026The Dark Knight Rises[Following, the, death, of, District, Attorney...[dccomics, crimefighter, terrorist, secretiden...[Action, Crime, Drama, Thriller][ChristianBale, MichaelCaine, GaryOldman][ChristopherNolan][Following, the, death, of, District, Attorney...
449529John Carter[John, Carter, is, a, war-weary,, former, mili...[basedonnovel, mars, medallion, spacetravel, p...[Action, Adventure, ScienceFiction][TaylorKitsch, LynnCollins, SamanthaMorton][AndrewStanton][John, Carter, is, a, war-weary,, former, mili...
\n", "
" ], "text/plain": [ " movie_id title \\\n", "0 19995 Avatar \n", "1 285 Pirates of the Caribbean: At World's End \n", "2 206647 Spectre \n", "3 49026 The Dark Knight Rises \n", "4 49529 John Carter \n", "\n", " overview \\\n", "0 [In, the, 22nd, century,, a, paraplegic, Marin... \n", "1 [Captain, Barbossa,, long, believed, to, be, d... \n", "2 [A, cryptic, message, from, Bond’s, past, send... \n", "3 [Following, the, death, of, District, Attorney... \n", "4 [John, Carter, is, a, war-weary,, former, mili... \n", "\n", " 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", " 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", " cast crew \\\n", "0 [SamWorthington, ZoeSaldana, SigourneyWeaver] [JamesCameron] \n", "1 [JohnnyDepp, OrlandoBloom, KeiraKnightley] [GoreVerbinski] \n", "2 [DanielCraig, ChristophWaltz, LéaSeydoux] [SamMendes] \n", "3 [ChristianBale, MichaelCaine, GaryOldman] [ChristopherNolan] \n", "4 [TaylorKitsch, LynnCollins, SamanthaMorton] [AndrewStanton] \n", "\n", " tags \n", "0 [In, the, 22nd, century,, a, paraplegic, Marin... \n", "1 [Captain, Barbossa,, long, believed, to, be, d... \n", "2 [A, cryptic, message, from, Bond’s, past, send... \n", "3 [Following, the, death, of, District, Attorney... \n", "4 [John, Carter, is, a, war-weary,, former, mili... " ] }, "execution_count": 33, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movies.head()" ] }, { "cell_type": "code", "execution_count": 34, "id": "cd33fef9", "metadata": {}, "outputs": [], "source": [ "new_df=movies[['movie_id','title','tags']]" ] }, { "cell_type": "code", "execution_count": 35, "id": "a8759add", "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", "
movie_idtitletags
019995Avatar[In, the, 22nd, century,, a, paraplegic, Marin...
1285Pirates of the Caribbean: At World's End[Captain, Barbossa,, long, believed, to, be, d...
2206647Spectre[A, cryptic, message, from, Bond’s, past, send...
349026The Dark Knight Rises[Following, the, death, of, District, Attorney...
449529John Carter[John, Carter, is, a, war-weary,, former, mili...
............
48049367El Mariachi[El, Mariachi, just, wants, to, play, his, gui...
480572766Newlyweds[A, newlywed, couple's, honeymoon, is, upended...
4806231617Signed, Sealed, Delivered[\"Signed,, Sealed,, Delivered\", introduces, a,...
4807126186Shanghai Calling[When, ambitious, New, York, attorney, Sam, is...
480825975My Date with Drew[Ever, since, the, second, grade, when, he, fi...
\n", "

4806 rows × 3 columns

\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", "4804 9367 El Mariachi \n", "4805 72766 Newlyweds \n", "4806 231617 Signed, Sealed, Delivered \n", "4807 126186 Shanghai Calling \n", "4808 25975 My Date with Drew \n", "\n", " tags \n", "0 [In, the, 22nd, century,, a, paraplegic, Marin... \n", "1 [Captain, Barbossa,, long, believed, to, be, d... \n", "2 [A, cryptic, message, from, Bond’s, past, send... \n", "3 [Following, the, death, of, District, Attorney... \n", "4 [John, Carter, is, a, war-weary,, former, mili... \n", "... ... \n", "4804 [El, Mariachi, just, wants, to, play, his, gui... \n", "4805 [A, newlywed, couple's, honeymoon, is, upended... \n", "4806 [\"Signed,, Sealed,, Delivered\", introduces, a,... \n", "4807 [When, ambitious, New, York, attorney, Sam, is... \n", "4808 [Ever, since, the, second, grade, when, he, fi... \n", "\n", "[4806 rows x 3 columns]" ] }, "execution_count": 35, "metadata": {}, "output_type": "execute_result" } ], "source": [ "new_df" ] }, { "cell_type": "code", "execution_count": 36, "id": "fb902ce7", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "C:\\Users\\lenovo\\AppData\\Local\\Temp\\ipykernel_3336\\684433085.py:1: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame.\n", "Try using .loc[row_indexer,col_indexer] = value instead\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " new_df['tags']=new_df['tags'].apply(lambda x: \" \".join(x))\n" ] } ], "source": [ "new_df['tags']=new_df['tags'].apply(lambda x: \" \".join(x))" ] }, { "cell_type": "code", "execution_count": 37, "id": "4fad171e", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'In the 22nd century, a paraplegic Marine is dispatched to the moon Pandora on a unique mission, but becomes torn between following orders and protecting an alien civilization. Action Adventure Fantasy ScienceFiction cultureclash future spacewar spacecolony society spacetravel futuristic romance space alien tribe alienplanet cgi marine soldier battle loveaffair antiwar powerrelations mindandsoul 3d SamWorthington ZoeSaldana SigourneyWeaver JamesCameron'" ] }, "execution_count": 37, "metadata": {}, "output_type": "execute_result" } ], "source": [ "new_df['tags'][0]" ] }, { "cell_type": "code", "execution_count": 38, "id": "58a34e14", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0 in the 22nd century, a paraplegic marine is di...\n", "1 captain barbossa, long believed to be dead, ha...\n", "2 a cryptic message from bond’s past sends him o...\n", "3 following the death of district attorney harve...\n", "4 john carter is a war-weary, former military ca...\n", " ... \n", "4804 el mariachi just wants to play his guitar and ...\n", "4805 a newlywed couple's honeymoon is upended by th...\n", "4806 \"signed, sealed, delivered\" introduces a dedic...\n", "4807 when ambitious new york attorney sam is sent t...\n", "4808 ever since the second grade when he first saw ...\n", "Name: tags, Length: 4806, dtype: object" ] }, "execution_count": 38, "metadata": {}, "output_type": "execute_result" } ], "source": [ "new_df['tags'].apply(lambda x:x.lower())" ] }, { "cell_type": "code", "execution_count": 39, "id": "ce44785e", "metadata": {}, "outputs": [], "source": [ "from sklearn.feature_extraction.text import CountVectorizer" ] }, { "cell_type": "code", "execution_count": 40, "id": "858aaf28", "metadata": {}, "outputs": [], "source": [ "cv=CountVectorizer(max_features=5000,stop_words='english')" ] }, { "cell_type": "code", "execution_count": 41, "id": "5e063eb6", "metadata": {}, "outputs": [], "source": [ "vectors=cv.fit_transform(new_df['tags']).toarray()" ] }, { "cell_type": "code", "execution_count": 42, "id": "a08f7494", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(4806, 5000)" ] }, "execution_count": 42, "metadata": {}, "output_type": "execute_result" } ], "source": [ "cv.fit_transform(new_df['tags']).toarray().shape" ] }, { "cell_type": "code", "execution_count": 43, "id": "822ba9f1", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([0, 0, 0, ..., 0, 0, 0], dtype=int64)" ] }, "execution_count": 43, "metadata": {}, "output_type": "execute_result" } ], "source": [ "vectors[0]" ] }, { "cell_type": "code", "execution_count": 44, "id": "2428bd62", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "C:\\Users\\lenovo\\anaconda3\\lib\\site-packages\\sklearn\\utils\\deprecation.py:87: FutureWarning: Function get_feature_names is deprecated; get_feature_names is deprecated in 1.0 and will be removed in 1.2. Please use get_feature_names_out instead.\n", " warnings.warn(msg, category=FutureWarning)\n" ] }, { "data": { "text/plain": [ "['000',\n", " '007',\n", " '10',\n", " '100',\n", " '11',\n", " '12',\n", " '13',\n", " '14',\n", " '15',\n", " '16',\n", " '17',\n", " '18',\n", " '18th',\n", " '19',\n", " '1930s',\n", " '1940s',\n", " '1950',\n", " '1950s',\n", " '1960s',\n", " '1970s',\n", " '1980',\n", " '1980s',\n", " '1985',\n", " '1990s',\n", " '1999',\n", " '19th',\n", " '19thcentury',\n", " '20',\n", " '200',\n", " '2009',\n", " '20th',\n", " '24',\n", " '25',\n", " '30',\n", " '300',\n", " '3d',\n", " '40',\n", " '50',\n", " '500',\n", " '60',\n", " '60s',\n", " '70',\n", " '70s',\n", " 'aaron',\n", " 'aaroneckhart',\n", " 'abandoned',\n", " 'abducted',\n", " 'abigailbreslin',\n", " 'abilities',\n", " 'ability',\n", " 'able',\n", " 'aboard',\n", " 'abuse',\n", " 'abusive',\n", " 'academy',\n", " 'accept',\n", " 'accepted',\n", " 'accepts',\n", " 'access',\n", " 'accident',\n", " 'accidental',\n", " 'accidentally',\n", " 'accompanied',\n", " 'accomplish',\n", " 'account',\n", " 'accountant',\n", " 'accused',\n", " 'ace',\n", " 'achieve',\n", " 'act',\n", " 'acting',\n", " 'action',\n", " 'actionhero',\n", " 'actions',\n", " 'activist',\n", " 'activities',\n", " 'activity',\n", " 'actor',\n", " 'actors',\n", " 'actress',\n", " 'acts',\n", " 'actual',\n", " 'actually',\n", " 'adam',\n", " 'adams',\n", " 'adamsandler',\n", " 'adamshankman',\n", " 'adaptation',\n", " 'adapted',\n", " 'addict',\n", " 'addicted',\n", " 'addiction',\n", " 'adolescence',\n", " 'adolescent',\n", " 'adopt',\n", " 'adopted',\n", " 'adoption',\n", " 'adopts',\n", " 'adrienbrody',\n", " 'adult',\n", " 'adultanimation',\n", " 'adultery',\n", " 'adulthood',\n", " 'adults',\n", " 'advantage',\n", " 'adventure',\n", " 'adventures',\n", " 'advertising',\n", " 'advice',\n", " 'affair',\n", " 'affairs',\n", " 'affection',\n", " 'affections',\n", " 'afghanistan',\n", " 'africa',\n", " 'african',\n", " 'africanamerican',\n", " 'aftercreditsstinger',\n", " 'afterlife',\n", " 'aftermath',\n", " 'age',\n", " 'aged',\n", " 'agedifference',\n", " 'agency',\n", " 'agenda',\n", " 'agent',\n", " 'agents',\n", " 'aggressive',\n", " 'aging',\n", " 'ago',\n", " 'agree',\n", " 'agrees',\n", " 'ahead',\n", " 'aid',\n", " 'aided',\n", " 'aids',\n", " 'ailing',\n", " 'air',\n", " 'airplane',\n", " 'airplanecrash',\n", " 'airport',\n", " 'aka',\n", " 'al',\n", " 'alabama',\n", " 'alan',\n", " 'alaska',\n", " 'albert',\n", " 'alcohol',\n", " 'alcoholic',\n", " 'alcoholism',\n", " 'alecbaldwin',\n", " 'alex',\n", " 'alfredhitchcock',\n", " 'ali',\n", " 'alice',\n", " 'alien',\n", " 'alieninvasion',\n", " 'alienlife',\n", " 'aliens',\n", " 'alike',\n", " 'alive',\n", " 'allen',\n", " 'alliance',\n", " 'allied',\n", " 'allies',\n", " 'allow',\n", " 'allowing',\n", " 'allows',\n", " 'ally',\n", " 'alongside',\n", " 'alpacino',\n", " 'alpha',\n", " 'alter',\n", " 'alternate',\n", " 'alternative',\n", " 'alzheimer',\n", " 'amanda',\n", " 'amandapeet',\n", " 'amandaseyfried',\n", " 'amateur',\n", " 'amazing',\n", " 'ambassador',\n", " 'ambition',\n", " 'ambitious',\n", " 'ambulance',\n", " 'ambush',\n", " 'america',\n", " 'american',\n", " 'americanabroad',\n", " 'americanfootball',\n", " 'americans',\n", " 'amid',\n", " 'amidst',\n", " 'amnesia',\n", " 'amp',\n", " 'amsterdam',\n", " 'amusementpark',\n", " 'amy',\n", " 'amyadams',\n", " 'amysmart',\n", " 'ana',\n", " 'anakin',\n", " 'analyst',\n", " 'anarchiccomedy',\n", " 'ancient',\n", " 'ancientrome',\n", " 'ancientworld',\n", " 'anderson',\n", " 'andiemacdowell',\n", " 'andrew',\n", " 'android',\n", " 'andy',\n", " 'andygarcía',\n", " 'angel',\n", " 'angelabassett',\n", " 'angeles',\n", " 'angelinajolie',\n", " 'angels',\n", " 'anger',\n", " 'anglee',\n", " 'angry',\n", " 'animal',\n", " 'animalattack',\n", " 'animalhorror',\n", " 'animals',\n", " 'animated',\n", " 'animation',\n", " 'anna',\n", " 'annafaris',\n", " 'anne',\n", " 'annehathaway',\n", " 'annemoss',\n", " 'annettebening',\n", " 'annie',\n", " 'anniversary',\n", " 'annual',\n", " 'answer',\n", " 'answers',\n", " 'ant',\n", " 'anthology',\n", " 'anthony',\n", " 'anthonyanderson',\n", " 'anthonyhopkins',\n", " 'anthropomorphism',\n", " 'anti',\n", " 'antics',\n", " 'antihero',\n", " 'antoinefuqua',\n", " 'antoniobanderas',\n", " 'antonyelchin',\n", " 'apart',\n", " 'apartheid',\n", " 'apartment',\n", " 'ape',\n", " 'apes',\n", " 'apocalypse',\n", " 'apocalyptic',\n", " 'apparent',\n", " 'apparently',\n", " 'appear',\n", " 'appears',\n", " 'apple',\n", " 'appointed',\n", " 'apprentice',\n", " 'approach',\n", " 'approaches',\n", " 'approaching',\n", " 'april',\n", " 'aquarium',\n", " 'arab',\n", " 'arch',\n", " 'archaeologist',\n", " 'architect',\n", " 'arctic',\n", " 'area',\n", " 'aren',\n", " 'arena',\n", " 'argument',\n", " 'arise',\n", " 'aristocrat',\n", " 'armed',\n", " 'arms',\n", " 'army',\n", " 'arnold',\n", " 'arnoldschwarzenegger',\n", " 'arrangedmarriage',\n", " 'arrest',\n", " 'arrested',\n", " 'arrival',\n", " 'arrive',\n", " 'arrives',\n", " 'arriving',\n", " 'arrogant',\n", " 'art',\n", " 'arthur',\n", " 'artificialintelligence',\n", " 'artist',\n", " 'artistic',\n", " 'artists',\n", " 'arts',\n", " 'ashley',\n", " 'ashleyjudd',\n", " 'ashtonkutcher',\n", " 'asia',\n", " 'asian',\n", " 'aside',\n", " 'ask',\n", " 'asked',\n", " 'asking',\n", " 'asks',\n", " 'aspirations',\n", " 'aspiring',\n", " 'assassin',\n", " 'assassinate',\n", " 'assassination',\n", " 'assassins',\n", " 'assault',\n", " 'assigned',\n", " 'assignment',\n", " 'assistant',\n", " 'assumes',\n", " 'asteroid',\n", " 'astronaut',\n", " 'astronauts',\n", " 'asylum',\n", " 'athlete',\n", " 'atomicbomb',\n", " 'attack',\n", " 'attacked',\n", " 'attacks',\n", " 'attempt',\n", " 'attempting',\n", " 'attempts',\n", " 'attending',\n", " 'attends',\n", " 'attention',\n", " 'attitude',\n", " 'attorney',\n", " 'attracted',\n", " 'attraction',\n", " 'attractive',\n", " 'audience',\n", " 'audiences',\n", " 'audition',\n", " 'august',\n", " 'aunt',\n", " 'austin',\n", " 'australia',\n", " 'australian',\n", " 'author',\n", " 'authorities',\n", " 'authority',\n", " 'autism',\n", " 'auto',\n", " 'automobileracing',\n", " 'avenge',\n", " 'average',\n", " 'avoid',\n", " 'awaits',\n", " 'awakens',\n", " 'award',\n", " 'away',\n", " 'awry',\n", " 'ax',\n", " 'babe',\n", " 'baby',\n", " 'bachelor',\n", " 'backdrop',\n", " 'backed',\n", " 'background',\n", " 'backgrounds',\n", " 'bad',\n", " 'badly',\n", " 'bag',\n", " 'bahamas',\n", " 'bail',\n", " 'balance',\n", " 'ball',\n", " 'ballet',\n", " 'baltimore',\n", " 'band',\n", " 'bandits',\n", " 'bangkok',\n", " 'banished',\n", " 'bank',\n", " 'banker',\n", " 'bankrobber',\n", " 'bankrobbery',\n", " 'bar',\n", " 'barely',\n", " 'bargained',\n", " 'barn',\n", " 'barney',\n", " 'barry',\n", " 'barrylevinson',\n", " 'bars',\n", " 'base',\n", " 'baseball',\n", " 'based',\n", " 'basedoncomicbook',\n", " 'basedongraphicnovel',\n", " 'basedonnovel',\n", " 'basedonplay',\n", " 'basedonstagemusical',\n", " 'basedontrueevents',\n", " 'basedontruestory',\n", " 'basedontvseries',\n", " 'basedonvideogame',\n", " 'basedonyoungadultnovel',\n", " 'basement',\n", " 'basketball',\n", " 'batman',\n", " 'battle',\n", " 'battlefield',\n", " 'battles',\n", " 'battling',\n", " 'bay',\n", " 'beach',\n", " 'bear',\n", " 'bears',\n", " 'beast',\n", " 'beasts',\n", " 'beat',\n", " 'beating',\n", " 'beautiful',\n", " 'beautifulwoman',\n", " 'beauty',\n", " 'becky',\n", " 'becominganadult',\n", " 'bed',\n", " 'bedroom',\n", " 'beer',\n", " 'befriends',\n", " 'began',\n", " 'begin',\n", " 'beginning',\n", " 'begins',\n", " 'behavior',\n", " 'beings',\n", " 'beliefs',\n", " 'believe',\n", " 'believed',\n", " 'believes',\n", " 'believing',\n", " 'beloved',\n", " 'ben',\n", " 'benaffleck',\n", " 'beneath',\n", " 'benfoster',\n", " 'beniciodeltoro',\n", " 'benjamin',\n", " 'benjaminbratt',\n", " 'benkingsley',\n", " 'bennett',\n", " 'benstiller',\n", " 'bent',\n", " 'berlin',\n", " 'best',\n", " 'bestfriend',\n", " 'bestfriendsinlove',\n", " 'bet',\n", " 'beth',\n", " 'betrayal',\n", " 'betrayed',\n", " 'bettemidler',\n", " 'better',\n", " 'betty',\n", " 'beverly',\n", " 'bible',\n", " 'big',\n", " 'bigger',\n", " 'biggest',\n", " 'biker',\n", " 'bikini',\n", " 'billhader',\n", " 'billionaire',\n", " 'billmurray',\n", " 'billnighy',\n", " 'billpaxton',\n", " 'billpullman',\n", " 'billy',\n", " 'billybobthornton',\n", " 'billycrudup',\n", " 'billycrystal',\n", " 'biography',\n", " 'bird',\n", " 'birth',\n", " 'birthday',\n", " 'bisexual',\n", " 'bishop',\n", " 'bit',\n", " 'bite',\n", " 'bitter',\n", " 'bizarre',\n", " 'black',\n", " 'blackmagic',\n", " 'blackmail',\n", " 'blackpeople',\n", " 'blacksmith',\n", " 'blade',\n", " 'blame',\n", " 'blind',\n", " 'bliss',\n", " 'block',\n", " 'blonde',\n", " 'blood',\n", " 'bloodsplatter',\n", " 'bloodthirsty',\n", " 'bloody',\n", " 'blow',\n", " 'blue',\n", " 'board',\n", " 'boarding',\n", " 'boardingschool',\n", " 'boat',\n", " 'bob',\n", " 'bobby',\n", " 'bobbyfarrelly',\n", " 'bobhoskins',\n", " 'bodies',\n", " 'body',\n", " 'bodyguard',\n", " 'bold',\n", " 'bollywood',\n", " 'bomb',\n", " 'bombing',\n", " 'bond',\n", " 'bonds',\n", " 'bone',\n", " 'book',\n", " 'books',\n", " 'border',\n", " 'bored',\n", " 'boredom',\n", " 'boring',\n", " 'born',\n", " 'boss',\n", " 'boston',\n", " 'botched',\n", " 'bound',\n", " 'boundaries',\n", " 'bounty',\n", " 'bountyhunter',\n", " 'bourne',\n", " 'box',\n", " 'boxer',\n", " 'boxing',\n", " 'boy',\n", " 'boyfriend',\n", " 'boys',\n", " 'bradleycooper',\n", " 'bradpitt',\n", " 'brain',\n", " 'brand',\n", " 'brave',\n", " 'bravery',\n", " 'brazil',\n", " 'brazilian',\n", " 'break',\n", " 'breakdown',\n", " 'breaking',\n", " 'breaks',\n", " 'brendanfraser',\n", " 'brendangleeson',\n", " 'brent',\n", " 'brettratner',\n", " 'brian',\n", " 'briandepalma',\n", " 'bride',\n", " 'bridesmaid',\n", " 'bridge',\n", " 'brief',\n", " 'brielarson',\n", " 'brien',\n", " 'bright',\n", " 'brilliant',\n", " 'bring',\n", " 'bringing',\n", " 'brings',\n", " 'brink',\n", " 'britain',\n", " 'british',\n", " 'britishsecretservice',\n", " 'brittanymurphy',\n", " 'broadway',\n", " 'broke',\n", " 'broken',\n", " 'broker',\n", " 'bronx',\n", " 'brooklyn',\n", " 'brooks',\n", " 'broom',\n", " 'brothel',\n", " 'brother',\n", " 'brotherbrotherrelationship',\n", " 'brothers',\n", " 'brothersisterrelationship',\n", " 'brought',\n", " 'brown',\n", " 'bruce',\n", " 'brucegreenwood',\n", " 'brucewillis',\n", " 'brutal',\n", " 'brutality',\n", " 'brutally',\n", " 'bryansinger',\n", " 'buck',\n", " 'buddies',\n", " 'buddy',\n", " 'buddycomedy',\n", " 'budget',\n", " 'build',\n", " 'building',\n", " 'built',\n", " 'bully',\n", " 'bullying',\n", " 'bumbling',\n", " 'bunny',\n", " 'burglar',\n", " 'buried',\n", " 'bus',\n", " 'bush',\n", " 'business',\n", " 'businessman',\n", " 'bust',\n", " 'busy',\n", " 'butcher',\n", " 'butler',\n", " 'buy',\n", " 'cabin',\n", " 'caesar',\n", " 'cage',\n", " 'cairo',\n", " 'cal',\n", " 'california',\n", " 'called',\n", " 'calls',\n", " 'calvin',\n", " 'camcorder',\n", " 'came',\n", " 'camera',\n", " 'cameraman',\n", " 'cameras',\n", " 'camerondiaz',\n", " 'camp',\n", " 'campaign',\n", " 'campbell',\n", " 'camping',\n", " 'campus',\n", " 'canada',\n", " 'canadian',\n", " 'cancer',\n", " 'candidate',\n", " 'candy',\n", " 'cannibal',\n", " 'capable',\n", " 'capital',\n", " 'capitalism',\n", " 'capt',\n", " 'captain',\n", " 'captive',\n", " 'capture',\n", " 'captured',\n", " 'captures',\n", " 'car',\n", " 'caraccident',\n", " 'carchase',\n", " 'carcrash',\n", " 'card',\n", " 'care',\n", " 'career',\n", " 'carefree',\n", " 'caretaker',\n", " 'caribbean',\n", " 'carjourney',\n", " 'carl',\n", " 'carlagugino',\n", " 'carmen',\n", " 'carol',\n", " 'carolina',\n", " 'carrace',\n", " 'carrie',\n", " 'carry',\n", " 'carrying',\n", " 'cars',\n", " 'cartel',\n", " 'carter',\n", " 'cartoon',\n", " 'caryelwes',\n", " 'case',\n", " 'caseyaffleck',\n", " 'cash',\n", " 'casino',\n", " 'cast',\n", " 'castle',\n", " 'cat',\n", " 'cataclysm',\n", " 'catastrophe',\n", " 'catch',\n", " 'catches',\n", " 'cateblanchett',\n", " 'catherinedeneuve',\n", " 'catherinekeener',\n", " 'catherinezeta',\n", " 'catholic',\n", " 'catholicism',\n", " 'cattle',\n", " 'caught',\n", " 'cause',\n", " 'caused',\n", " 'causes',\n", " 'causing',\n", " 'cavalry',\n", " 'cave',\n", " 'cavemen',\n", " 'celebrate',\n", " 'celebrated',\n", " 'celebration',\n", " 'celebrity',\n", " 'cellphone',\n", " 'cemetery',\n", " 'center',\n", " 'centered',\n", " 'centers',\n", " 'central',\n", " 'centuries',\n", " 'century',\n", " 'ceremony',\n", " 'certain',\n", " 'chain',\n", " 'chainsaw',\n", " 'challenge',\n", " 'challenged',\n", " 'challenges',\n", " 'champion',\n", " 'championship',\n", " 'chance',\n", " 'change',\n", " 'changed',\n", " 'changes',\n", " 'changing',\n", " 'channingtatum',\n", " 'chaos',\n", " 'chaotic',\n", " 'chapter',\n", " 'character',\n", " 'characters',\n", " 'charge',\n", " 'charged',\n", " 'charismatic',\n", " 'charles',\n", " 'charlie',\n", " 'charliesheen',\n", " 'charlizetheron',\n", " 'charlotte',\n", " 'charm',\n", " 'charming',\n", " 'chase',\n", " 'chased',\n", " 'chases',\n", " 'chauffeur',\n", " 'chazzpalminteri',\n", " 'cheating',\n", " 'cheerleader',\n", " 'chef',\n", " 'chemical',\n", " 'cher',\n", " 'chicago',\n", " 'chicken',\n", " 'chief',\n", " 'child',\n", " 'childabuse',\n", " 'childhero',\n", " 'childhood',\n", " 'children',\n", " 'chilling',\n", " 'china',\n", " 'chinese',\n", " 'chip',\n", " 'chiwetelejiofor',\n", " 'chloëgracemoretz',\n", " 'chloësevigny',\n", " 'chocolate',\n", " 'choice',\n", " 'choices',\n", " 'choose',\n", " 'chosen',\n", " 'chowyun',\n", " 'chris',\n", " 'chriscolumbus',\n", " 'chriscooper',\n", " 'chrisevans',\n", " 'chrishemsworth',\n", " 'chrisklein',\n", " 'chrispine',\n", " 'chrisrock',\n", " 'christ',\n", " 'christian',\n", " 'christianbale',\n", " 'christianity',\n", " 'christianslater',\n", " 'christinaapplegate',\n", " 'christinaricci',\n", " 'christine',\n", " 'christmas',\n", " 'christmasparty',\n", " 'christopher',\n", " 'christopherlloyd',\n", " 'christophernolan',\n", " 'christopherplummer',\n", " 'christopherwalken',\n", " 'christophwaltz',\n", " 'chrisweitz',\n", " 'chronicle',\n", " 'chronicles',\n", " 'chuck',\n", " 'church',\n", " 'cia',\n", " 'cigarettesmoking',\n", " 'cillianmurphy',\n", " 'cindy',\n", " 'cinema',\n", " 'circle',\n", " 'circuit',\n", " 'circumstances',\n", " 'circus',\n", " 'cities',\n", " 'citizens',\n", " 'city',\n", " 'civil',\n", " 'civilian',\n", " 'civilization',\n", " 'civilwar',\n", " 'claim',\n", " 'claims',\n", " 'claire',\n", " 'clairedanes',\n", " 'clan',\n", " 'clark',\n", " 'clash',\n", " 'class',\n", " 'classes',\n", " 'classic',\n", " 'classmate',\n", " 'classmates',\n", " 'classroom',\n", " 'claudevandamme',\n", " 'clay',\n", " 'clean',\n", " 'clear',\n", " 'clerk',\n", " 'client',\n", " 'clients',\n", " 'climate',\n", " 'climbing',\n", " 'clinteastwood',\n", " 'clique',\n", " 'cliveowen',\n", " 'clock',\n", " 'clone',\n", " 'cloning',\n", " 'close',\n", " 'closed',\n", " 'closer',\n", " 'club',\n", " 'clubs',\n", " 'clues',\n", " 'clutches',\n", " 'coach',\n", " 'coast',\n", " 'cocaine',\n", " 'code',\n", " 'cody',\n", " 'coffin',\n", " 'cohen',\n", " 'col',\n", " 'cold',\n", " 'coldwar',\n", " 'cole',\n", " 'colin',\n", " 'colinfarrell',\n", " 'colinfirth',\n", " 'collapse',\n", " 'colleague',\n", " 'colleagues',\n", " 'collect',\n", " 'collection',\n", " 'collector',\n", " 'college',\n", " 'collide',\n", " 'collision',\n", " 'colonel',\n", " 'colony',\n", " 'color',\n", " 'colorado',\n", " 'colorful',\n", " 'coma',\n", " 'combat',\n", " 'combined',\n", " 'come',\n", " 'comeback',\n", " 'comedian',\n", " 'comedic',\n", " 'comedy',\n", " 'comes',\n", " 'comet',\n", " 'comfort',\n", " 'comic',\n", " 'comics',\n", " 'coming',\n", " 'comingofage',\n", " 'comingout',\n", " 'command',\n", " 'commander',\n", " 'commercial',\n", " 'commit',\n", " 'commitment',\n", " 'committed',\n", " 'common',\n", " 'communication',\n", " 'community',\n", " 'companion',\n", " 'company',\n", " 'compete',\n", " 'competing',\n", " 'competition',\n", " 'complete',\n", " 'completely',\n", " 'complex',\n", " 'complicated',\n", " 'complications',\n", " 'composer',\n", " 'computer',\n", " 'computervirus',\n", " 'conan',\n", " 'concert',\n", " 'conclusion',\n", " 'condition',\n", " 'confederate',\n", " 'confession',\n", " 'confidence',\n", " 'confident',\n", " 'conflict',\n", " 'confront',\n", " 'confronted',\n", " 'confronts',\n", " 'confused',\n", " 'congress',\n", " 'conman',\n", " 'connected',\n", " 'connection',\n", " 'connell',\n", " 'connor',\n", " 'conquer',\n", " 'conscience',\n", " 'consequences',\n", " 'conservative',\n", " 'considered',\n", " 'conspiracy',\n", " 'conspire',\n", " 'constant',\n", " 'constantly',\n", " 'construction',\n", " 'consumed',\n", " 'contact',\n", " 'contain',\n", " 'contemporary',\n", " 'contend',\n", " 'contest',\n", " 'continue',\n", " 'continues',\n", " 'continuing',\n", " 'contract',\n", " 'control',\n", " 'controlled',\n", " 'controlling',\n", " 'controversial',\n", " 'convention',\n", " 'converge',\n", " 'convict',\n", " 'convicted',\n", " 'convince',\n", " 'convinced',\n", " 'convinces',\n", " 'cook',\n", " 'cooking',\n", " 'cool',\n", " 'cooper',\n", " 'cop',\n", " 'cope',\n", " 'cops',\n", " 'core',\n", " 'corner',\n", " 'corners',\n", " 'corporate',\n", " 'corporation',\n", " 'corpse',\n", " 'corrupt',\n", " 'corruption',\n", " 'cost',\n", " ...]" ] }, "execution_count": 44, "metadata": {}, "output_type": "execute_result" } ], "source": [ "cv.get_feature_names()" ] }, { "cell_type": "code", "execution_count": 45, "id": "463cc9eb", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Requirement already satisfied: nltk in c:\\users\\lenovo\\anaconda3\\lib\\site-packages (3.7)\n", "Requirement already satisfied: joblib in c:\\users\\lenovo\\anaconda3\\lib\\site-packages (from nltk) (1.1.0)\n", "Requirement already satisfied: regex>=2021.8.3 in c:\\users\\lenovo\\anaconda3\\lib\\site-packages (from nltk) (2022.3.15)\n", "Requirement already satisfied: tqdm in c:\\users\\lenovo\\anaconda3\\lib\\site-packages (from nltk) (4.64.0)\n", "Requirement already satisfied: click in c:\\users\\lenovo\\anaconda3\\lib\\site-packages (from nltk) (8.0.4)\n", "Requirement already satisfied: colorama in c:\\users\\lenovo\\anaconda3\\lib\\site-packages (from click->nltk) (0.4.4)\n", "Note: you may need to restart the kernel to use updated packages.\n" ] } ], "source": [ "\n", "pip install nltk" ] }, { "cell_type": "code", "execution_count": 46, "id": "e15a77c5", "metadata": {}, "outputs": [], "source": [ "import nltk\n" ] }, { "cell_type": "code", "execution_count": 47, "id": "0070a0b0", "metadata": {}, "outputs": [], "source": [ "from nltk.stem.porter import PorterStemmer" ] }, { "cell_type": "code", "execution_count": 48, "id": "5b8404cf", "metadata": {}, "outputs": [], "source": [ "ps=PorterStemmer()" ] }, { "cell_type": "code", "execution_count": 49, "id": "b1e0c202", "metadata": {}, "outputs": [], "source": [ "def stem(text):\n", " y=[]\n", " for i in text.split():#list me covert kar rhe hai\n", " y.append(ps.stem(i))\n", " return \" \".join(y) \n", " " ] }, { "cell_type": "code", "execution_count": 50, "id": "928e3679", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'In the 22nd century, a paraplegic Marine is dispatched to the moon Pandora on a unique mission, but becomes torn between following orders and protecting an alien civilization. Action Adventure Fantasy ScienceFiction cultureclash future spacewar spacecolony society spacetravel futuristic romance space alien tribe alienplanet cgi marine soldier battle loveaffair antiwar powerrelations mindandsoul 3d SamWorthington ZoeSaldana SigourneyWeaver JamesCameron'" ] }, "execution_count": 50, "metadata": {}, "output_type": "execute_result" } ], "source": [ "new_df['tags'][0]" ] }, { "cell_type": "code", "execution_count": 51, "id": "0a227c48", "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 jamescameron'" ] }, "execution_count": 51, "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 JamesCameron')" ] }, { "cell_type": "code", "execution_count": 52, "id": "1fcb6b44", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "C:\\Users\\lenovo\\AppData\\Local\\Temp\\ipykernel_3336\\3514595201.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": null, "id": "304a123f", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 53, "id": "35740418", "metadata": {}, "outputs": [], "source": [ "vectors=cv.fit_transform(new_df['tags']).toarray()" ] }, { "cell_type": "code", "execution_count": 54, "id": "7a8a3123", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(4806, 5000)" ] }, "execution_count": 54, "metadata": {}, "output_type": "execute_result" } ], "source": [ "cv.fit_transform(new_df['tags']).toarray().shape" ] }, { "cell_type": "code", "execution_count": 55, "id": "c354736d", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['000',\n", " '007',\n", " '10',\n", " '100',\n", " '11',\n", " '12',\n", " '13',\n", " '14',\n", " '15',\n", " '16',\n", " '17',\n", " '17th',\n", " '18',\n", " '18th',\n", " '18thcenturi',\n", " '19',\n", " '1910',\n", " '1920',\n", " '1930',\n", " '1940',\n", " '1944',\n", " '1950',\n", " '1950s',\n", " '1960',\n", " '1960s',\n", " '1970',\n", " '1970s',\n", " '1971',\n", " '1974',\n", " '1976',\n", " '1980',\n", " '1985',\n", " '1990',\n", " '1999',\n", " '19th',\n", " '19thcenturi',\n", " '20',\n", " '200',\n", " '2003',\n", " '2009',\n", " '20th',\n", " '21st',\n", " '23',\n", " '24',\n", " '25',\n", " '30',\n", " '300',\n", " '3d',\n", " '40',\n", " '50',\n", " '500',\n", " '60',\n", " '70',\n", " '80',\n", " 'aaron',\n", " 'aaroneckhart',\n", " 'abandon',\n", " 'abduct',\n", " 'abigailbreslin',\n", " 'abil',\n", " 'abl',\n", " 'aboard',\n", " 'abov',\n", " 'abus',\n", " 'academ',\n", " 'academi',\n", " 'accept',\n", " 'access',\n", " 'accid',\n", " 'accident',\n", " 'acclaim',\n", " 'accompani',\n", " 'accomplish',\n", " 'account',\n", " 'accus',\n", " 'ace',\n", " 'achiev',\n", " 'acquaint',\n", " 'act',\n", " 'action',\n", " 'actionhero',\n", " 'activ',\n", " 'activist',\n", " 'activities',\n", " 'actor',\n", " 'actress',\n", " 'actual',\n", " 'ad',\n", " 'adam',\n", " 'adamsandl',\n", " 'adamshankman',\n", " 'adapt',\n", " 'add',\n", " 'addict',\n", " 'adjust',\n", " 'admir',\n", " 'admit',\n", " 'adolesc',\n", " 'adopt',\n", " 'ador',\n", " 'adrienbrodi',\n", " 'adult',\n", " 'adultanim',\n", " 'adulteri',\n", " 'adulthood',\n", " 'advanc',\n", " 'adventur',\n", " 'adventure',\n", " 'adventures',\n", " 'advertis',\n", " 'advic',\n", " 'advis',\n", " 'affair',\n", " 'affect',\n", " 'afghanistan',\n", " 'africa',\n", " 'african',\n", " 'africanamerican',\n", " 'aftercreditssting',\n", " 'afterlif',\n", " 'aftermath',\n", " 'ag',\n", " 'age',\n", " 'agediffer',\n", " 'agenc',\n", " 'agency',\n", " 'agenda',\n", " 'agent',\n", " 'agents',\n", " 'aggress',\n", " 'ago',\n", " 'agre',\n", " 'ahead',\n", " 'aid',\n", " 'aidanquinn',\n", " 'ail',\n", " 'aim',\n", " 'air',\n", " 'airplan',\n", " 'airplanecrash',\n", " 'airport',\n", " 'aka',\n", " 'al',\n", " 'alabama',\n", " 'alan',\n", " 'alaska',\n", " 'albert',\n", " 'alcatraz',\n", " 'alcohol',\n", " 'alecbaldwin',\n", " 'alex',\n", " 'alexkendrick',\n", " 'alfredhitchcock',\n", " 'alfredmolina',\n", " 'ali',\n", " 'alic',\n", " 'alice',\n", " 'alien',\n", " 'alieninvas',\n", " 'alienlife',\n", " 'alienplanet',\n", " 'aliens',\n", " 'alik',\n", " 'aliv',\n", " 'alive',\n", " 'allen',\n", " 'alli',\n", " 'allianc',\n", " 'allow',\n", " 'alon',\n", " 'alongsid',\n", " 'alpacino',\n", " 'alpha',\n", " 'alreadi',\n", " 'alter',\n", " 'altern',\n", " 'alway',\n", " 'alyssa',\n", " 'alzheimer',\n", " 'amanda',\n", " 'amandapeet',\n", " 'amandaseyfri',\n", " 'amateur',\n", " 'amaz',\n", " 'amazon',\n", " 'ambassador',\n", " 'ambit',\n", " 'ambiti',\n", " 'ambul',\n", " 'ambush',\n", " 'america',\n", " 'american',\n", " 'americanabroad',\n", " 'americancivilwar',\n", " 'americanfootbal',\n", " 'americanfootballplay',\n", " 'amid',\n", " 'amidst',\n", " 'amnesia',\n", " 'amp',\n", " 'amsterdam',\n", " 'amus',\n", " 'amusementpark',\n", " 'amy',\n", " 'amyadam',\n", " 'amysmart',\n", " 'ana',\n", " 'anakin',\n", " 'analyst',\n", " 'anarchiccomedi',\n", " 'ancient',\n", " 'ancientrom',\n", " 'ancientworld',\n", " 'anderson',\n", " 'andi',\n", " 'andiemacdowel',\n", " 'andrew',\n", " 'android',\n", " 'andy',\n", " 'andygarcía',\n", " 'angel',\n", " 'angela',\n", " 'angelabassett',\n", " 'angeles',\n", " 'angelinajoli',\n", " 'anger',\n", " 'angle',\n", " 'angri',\n", " 'ani',\n", " 'anim',\n", " 'animalattack',\n", " 'animalhorror',\n", " 'animals',\n", " 'anjelicahuston',\n", " 'ann',\n", " 'anna',\n", " 'annafari',\n", " 'annakendrick',\n", " 'anne',\n", " 'annehathaway',\n", " 'annemoss',\n", " 'annetteben',\n", " 'anni',\n", " 'annie',\n", " 'anniversari',\n", " 'announc',\n", " 'annual',\n", " 'anonym',\n", " 'anoth',\n", " 'answer',\n", " 'ant',\n", " 'antholog',\n", " 'anthoni',\n", " 'anthonyanderson',\n", " 'anthonyhopkin',\n", " 'anthropomorph',\n", " 'anti',\n", " 'antic',\n", " 'antihero',\n", " 'antiqu',\n", " 'antoinefuqua',\n", " 'antoniobandera',\n", " 'antonyelchin',\n", " 'anyon',\n", " 'anyth',\n", " 'apart',\n", " 'apartheid',\n", " 'apartment',\n", " 'ape',\n", " 'apocalyps',\n", " 'apocalypse',\n", " 'apocalypt',\n", " 'appar',\n", " 'appear',\n", " 'appl',\n", " 'apple',\n", " 'appoint',\n", " 'appreci',\n", " 'apprentic',\n", " 'approach',\n", " 'april',\n", " 'aquarium',\n", " 'arab',\n", " 'arch',\n", " 'archaeologist',\n", " 'archeolog',\n", " 'archer',\n", " 'architect',\n", " 'arctic',\n", " 'area',\n", " 'aren',\n", " 'arena',\n", " 'argument',\n", " 'aris',\n", " 'aristocrat',\n", " 'arm',\n", " 'armi',\n", " 'armor',\n", " 'armsdeal',\n", " 'army',\n", " 'arnold',\n", " 'arnoldschwarzenegg',\n", " 'arrang',\n", " 'arrangedmarriag',\n", " 'arrest',\n", " 'arriv',\n", " 'arrog',\n", " 'art',\n", " 'arthur',\n", " 'artifact',\n", " 'artifici',\n", " 'artificialintellig',\n", " 'artist',\n", " 'ash',\n", " 'ashley',\n", " 'ashleyjudd',\n", " 'ashtonkutch',\n", " 'asia',\n", " 'asian',\n", " 'asid',\n", " 'ask',\n", " 'aspect',\n", " 'aspir',\n", " 'assassin',\n", " 'assault',\n", " 'assembl',\n", " 'assign',\n", " 'assist',\n", " 'assistant',\n", " 'associ',\n", " 'assum',\n", " 'asteroid',\n", " 'astronaut',\n", " 'asylum',\n", " 'atheist',\n", " 'athlet',\n", " 'atom',\n", " 'atomicbomb',\n", " 'attack',\n", " 'attacks',\n", " 'attempt',\n", " 'attend',\n", " 'attent',\n", " 'attic',\n", " 'attitud',\n", " 'attorney',\n", " 'attract',\n", " 'auction',\n", " 'audienc',\n", " 'audit',\n", " 'august',\n", " 'aunt',\n", " 'austin',\n", " 'australia',\n", " 'australian',\n", " 'author',\n", " 'autism',\n", " 'auto',\n", " 'automobilerac',\n", " 'aveng',\n", " 'averag',\n", " 'avoid',\n", " 'await',\n", " 'awak',\n", " 'awaken',\n", " 'awar',\n", " 'award',\n", " 'away',\n", " 'awkward',\n", " 'awri',\n", " 'awry',\n", " 'ax',\n", " 'babe',\n", " 'babi',\n", " 'baby',\n", " 'bachelor',\n", " 'backdrop',\n", " 'background',\n", " 'backpack',\n", " 'bad',\n", " 'bag',\n", " 'bahama',\n", " 'bail',\n", " 'balanc',\n", " 'ball',\n", " 'ballet',\n", " 'balloon',\n", " 'baltimor',\n", " 'ban',\n", " 'band',\n", " 'bandit',\n", " 'bangkok',\n", " 'banish',\n", " 'bank',\n", " 'banker',\n", " 'bankrobb',\n", " 'bankrobberi',\n", " 'bar',\n", " 'barbrastreisand',\n", " 'bare',\n", " 'bargain',\n", " 'barn',\n", " 'barney',\n", " 'baron',\n", " 'barri',\n", " 'barrylevinson',\n", " 'barrysonnenfeld',\n", " 'bas',\n", " 'base',\n", " 'basebal',\n", " 'basedoncomicbook',\n", " 'basedongraphicnovel',\n", " 'basedonnovel',\n", " 'basedonplay',\n", " 'basedonstagemus',\n", " 'basedontrueev',\n", " 'basedontruestori',\n", " 'basedontvseri',\n", " 'basedonvideogam',\n", " 'basedonyoungadultnovel',\n", " 'basement',\n", " 'basketbal',\n", " 'basketball',\n", " 'bat',\n", " 'batman',\n", " 'battl',\n", " 'battle',\n", " 'battlefield',\n", " 'bay',\n", " 'beach',\n", " 'beam',\n", " 'bear',\n", " 'beard',\n", " 'beast',\n", " 'beat',\n", " 'beauti',\n", " 'beautiful',\n", " 'beautifulwoman',\n", " 'beauty',\n", " 'becam',\n", " 'becaus',\n", " 'becki',\n", " 'becom',\n", " 'becominganadult',\n", " 'bed',\n", " 'bedroom',\n", " 'bee',\n", " 'beer',\n", " 'befor',\n", " 'befriend',\n", " 'began',\n", " 'begin',\n", " 'begins',\n", " 'behavior',\n", " 'belief',\n", " 'believ',\n", " 'bell',\n", " 'bella',\n", " 'belong',\n", " 'belov',\n", " 'ben',\n", " 'benaffleck',\n", " 'bend',\n", " 'beneath',\n", " 'benefit',\n", " 'benfost',\n", " 'beniciodeltoro',\n", " 'benjamin',\n", " 'benjaminbratt',\n", " 'benkingsley',\n", " 'bennett',\n", " 'benstil',\n", " 'bent',\n", " 'berlin',\n", " 'best',\n", " 'bestfriend',\n", " 'bestfriendsinlov',\n", " 'bet',\n", " 'beth',\n", " 'betray',\n", " 'bettemidl',\n", " 'better',\n", " 'betti',\n", " 'beverli',\n", " 'bibl',\n", " 'bid',\n", " 'big',\n", " 'bigger',\n", " 'biggest',\n", " 'bike',\n", " 'biker',\n", " 'bikini',\n", " 'billhad',\n", " 'billi',\n", " 'billionair',\n", " 'billmurray',\n", " 'billnighi',\n", " 'billpaxton',\n", " 'billpullman',\n", " 'billybobthornton',\n", " 'billycrudup',\n", " 'billycryst',\n", " 'biographi',\n", " 'biolog',\n", " 'bird',\n", " 'birth',\n", " 'birthday',\n", " 'bisexu',\n", " 'bishop',\n", " 'bit',\n", " 'bite',\n", " 'bitter',\n", " 'bizarr',\n", " 'black',\n", " 'blackmag',\n", " 'blackmail',\n", " 'blackpeopl',\n", " 'blacksmith',\n", " 'blade',\n", " 'blame',\n", " 'blend',\n", " 'blind',\n", " 'bliss',\n", " 'blizzard',\n", " 'block',\n", " 'blond',\n", " 'blood',\n", " 'bloodi',\n", " 'bloodsplatt',\n", " 'bloodthirsti',\n", " 'blow',\n", " 'blue',\n", " 'board',\n", " 'boardingschool',\n", " 'boat',\n", " 'bob',\n", " 'bobbi',\n", " 'bobbyfarrelli',\n", " 'bobhoskin',\n", " 'bodi',\n", " 'body',\n", " 'bodyguard',\n", " 'bold',\n", " 'bollywood',\n", " 'bomb',\n", " 'bond',\n", " 'bone',\n", " 'book',\n", " 'border',\n", " 'bore',\n", " 'boredom',\n", " 'born',\n", " 'boss',\n", " 'boston',\n", " 'botch',\n", " 'bound',\n", " 'boundari',\n", " 'bounti',\n", " 'bountyhunt',\n", " 'bout',\n", " 'box',\n", " 'boxer',\n", " 'boy',\n", " 'boyfriend',\n", " 'boys',\n", " 'bradleycoop',\n", " 'bradpitt',\n", " 'brain',\n", " 'brainwash',\n", " 'brand',\n", " 'brandon',\n", " 'brave',\n", " 'braveri',\n", " 'brazil',\n", " 'brazilian',\n", " 'break',\n", " 'breakdown',\n", " 'breast',\n", " 'breath',\n", " 'breed',\n", " 'brendanfras',\n", " 'brendangleeson',\n", " 'brent',\n", " 'brettratn',\n", " 'brian',\n", " 'briandepalma',\n", " 'bride',\n", " 'bridesmaid',\n", " 'bridg',\n", " 'brief',\n", " 'brielarson',\n", " 'brien',\n", " 'bright',\n", " 'brilliant',\n", " 'bring',\n", " 'brink',\n", " 'britain',\n", " 'british',\n", " 'britishsecretservic',\n", " 'brittanymurphi',\n", " 'broadcast',\n", " 'broadway',\n", " 'broke',\n", " 'broken',\n", " 'broker',\n", " 'bronx',\n", " 'brook',\n", " 'brooklyn',\n", " 'broom',\n", " 'brothel',\n", " 'brother',\n", " 'brotherbrotherrelationship',\n", " 'brothers',\n", " 'brothersisterrelationship',\n", " 'brought',\n", " 'brown',\n", " 'bruce',\n", " 'brucegreenwood',\n", " 'brucewilli',\n", " 'brutal',\n", " 'bryansing',\n", " 'bu',\n", " 'buck',\n", " 'bud',\n", " 'buddi',\n", " 'buddy',\n", " 'buddycomedi',\n", " 'buddycop',\n", " 'budget',\n", " 'build',\n", " 'building',\n", " 'built',\n", " 'bullet',\n", " 'bulli',\n", " 'bumbl',\n", " 'bunch',\n", " 'bunker',\n", " 'bunni',\n", " 'burglar',\n", " 'buri',\n", " 'burn',\n", " 'bush',\n", " 'busi',\n", " 'business',\n", " 'businessman',\n", " 'bust',\n", " 'butcher',\n", " 'butler',\n", " 'butt',\n", " 'button',\n", " 'buy',\n", " 'buzz',\n", " 'cabin',\n", " 'caesar',\n", " 'cage',\n", " 'cairo',\n", " 'cal',\n", " 'california',\n", " 'calvin',\n", " 'camcord',\n", " 'came',\n", " 'camera',\n", " 'cameraman',\n", " 'camerondiaz',\n", " 'camp',\n", " 'campaign',\n", " 'campbell',\n", " 'campu',\n", " 'canada',\n", " 'canadian',\n", " 'cancer',\n", " 'candi',\n", " 'candid',\n", " 'canin',\n", " 'cannib',\n", " 'canuxploit',\n", " 'capabl',\n", " 'caper',\n", " 'capit',\n", " 'capt',\n", " 'captain',\n", " 'captiv',\n", " 'captur',\n", " 'capture',\n", " 'car',\n", " 'caraccid',\n", " 'carchas',\n", " 'carcrash',\n", " 'card',\n", " 'care',\n", " 'career',\n", " 'carefre',\n", " 'caretak',\n", " 'careymulligan',\n", " 'caribbean',\n", " 'carjourney',\n", " 'carl',\n", " 'carlagugino',\n", " 'carmen',\n", " 'carol',\n", " 'carolina',\n", " 'carrac',\n", " 'carri',\n", " 'carrie',\n", " 'cartel',\n", " 'carter',\n", " 'cartoon',\n", " 'caryelw',\n", " 'case',\n", " 'caseyaffleck',\n", " 'cash',\n", " 'casino',\n", " 'cast',\n", " 'castl',\n", " 'cat',\n", " 'cataclysm',\n", " 'catastroph',\n", " 'catch',\n", " 'cateblanchett',\n", " 'catherinedeneuv',\n", " 'catherinekeen',\n", " 'catherinezeta',\n", " 'cathol',\n", " 'catholic',\n", " 'cattl',\n", " 'caught',\n", " 'caus',\n", " 'cavalri',\n", " 'cave',\n", " 'cavemen',\n", " 'celebr',\n", " 'celebration',\n", " 'cell',\n", " 'cellphon',\n", " 'cemeteri',\n", " 'center',\n", " 'centr',\n", " 'central',\n", " 'centuri',\n", " 'centuries',\n", " 'century',\n", " 'ceo',\n", " 'certain',\n", " 'chad',\n", " 'chain',\n", " 'chainsaw',\n", " 'challeng',\n", " 'chamber',\n", " 'champion',\n", " 'championship',\n", " 'chanc',\n", " 'chance',\n", " 'chang',\n", " 'change',\n", " 'changed',\n", " 'changes',\n", " 'channingtatum',\n", " 'chao',\n", " 'chaos',\n", " 'chaotic',\n", " 'chapter',\n", " 'charact',\n", " 'character',\n", " 'characters',\n", " 'charg',\n", " 'charismat',\n", " 'charl',\n", " 'charli',\n", " 'charlie',\n", " 'charliesheen',\n", " 'charlizetheron',\n", " 'charm',\n", " 'chart',\n", " 'chase',\n", " 'chauffeur',\n", " 'chazzpalminteri',\n", " 'cheat',\n", " 'check',\n", " 'cheerlead',\n", " 'chef',\n", " 'chemic',\n", " 'cher',\n", " 'chevychas',\n", " 'chicago',\n", " 'chicken',\n", " 'chief',\n", " 'child',\n", " 'childabus',\n", " 'childhero',\n", " 'childhood',\n", " 'childprodigi',\n", " 'children',\n", " 'chill',\n", " 'chimp',\n", " 'china',\n", " 'chines',\n", " 'chip',\n", " 'chipmunk',\n", " 'chiwetelejiofor',\n", " 'chloe',\n", " 'chloëgracemoretz',\n", " 'chloësevigni',\n", " 'chocol',\n", " 'choic',\n", " 'choice',\n", " 'choos',\n", " 'chosen',\n", " 'chowyun',\n", " 'chri',\n", " 'chriscolumbu',\n", " 'chriscoop',\n", " 'chrisevan',\n", " 'chrishemsworth',\n", " 'chrisklein',\n", " 'chrispin',\n", " 'chrisrock',\n", " 'christ',\n", " 'christian',\n", " 'christianbal',\n", " 'christianslat',\n", " 'christin',\n", " 'christinaappleg',\n", " 'christinaricci',\n", " 'christma',\n", " 'christmas',\n", " 'christmasparti',\n", " 'christmastre',\n", " 'christoph',\n", " 'christopherlambert',\n", " 'christopherlloyd',\n", " 'christophernolan',\n", " 'christopherplumm',\n", " 'christopherwalken',\n", " 'christophwaltz',\n", " 'chrisweitz',\n", " 'chronicl',\n", " 'chuck',\n", " 'church',\n", " 'cia',\n", " 'ciaránhind',\n", " 'cigarettesmok',\n", " 'cillianmurphi',\n", " 'cinema',\n", " 'circl',\n", " 'circu',\n", " 'circuit',\n", " 'circumst',\n", " 'citi',\n", " 'citizen',\n", " 'city',\n", " 'civil',\n", " 'civilian',\n", " 'civilwar',\n", " 'claim',\n", " 'clair',\n", " 'clairedan',\n", " 'claireforlani',\n", " 'clan',\n", " 'clark',\n", " 'clash',\n", " 'class',\n", " 'classdiffer',\n", " 'classic',\n", " 'classmat',\n", " 'classroom',\n", " 'claudevandamm',\n", " 'clay',\n", " 'clean',\n", " 'clear',\n", " 'clerk',\n", " 'clever',\n", " 'client',\n", " 'clients',\n", " 'cliff',\n", " 'climat',\n", " 'climb',\n", " 'clinteastwood',\n", " 'cliveowen',\n", " 'clock',\n", " 'clone',\n", " 'close',\n", " 'closer',\n", " 'cloud',\n", " 'clown',\n", " 'club',\n", " 'clue',\n", " 'clueless',\n", " 'clutch',\n", " 'coach',\n", " 'coast',\n", " 'cocain',\n", " 'code',\n", " 'coffin',\n", " 'cohen',\n", " 'col',\n", " 'cold',\n", " 'coldwar',\n", " 'cole',\n", " 'colin',\n", " 'colinfarrel',\n", " 'colinfirth',\n", " 'collaps',\n", " 'colleagu',\n", " 'collect',\n", " 'collector',\n", " 'colleg',\n", " 'college',\n", " 'collid',\n", " 'collis',\n", " 'colombia',\n", " 'colonel',\n", " 'coloni',\n", " 'color',\n", " 'colorado',\n", " 'coma',\n", " 'combat',\n", " 'combin',\n", " 'come',\n", " 'comeback',\n", " 'comed',\n", " 'comedi',\n", " 'comedian',\n", " 'comedy',\n", " 'comet',\n", " 'comfort',\n", " 'comic',\n", " 'coming',\n", " 'comingofag',\n", " 'comingout',\n", " 'command',\n", " 'commando',\n", " 'commerci',\n", " 'commiss',\n", " 'commit',\n", " 'common',\n", " 'commun',\n", " 'communist',\n", " 'community',\n", " 'compani',\n", " 'companion',\n", " 'company',\n", " 'compet',\n", " 'competit',\n", " 'competition',\n", " 'complet',\n", " 'complex',\n", " 'complic',\n", " 'compos',\n", " 'compuls',\n", " 'comput',\n", " 'computerviru',\n", " 'conan',\n", " 'concern',\n", " 'concert',\n", " 'concoct',\n", " 'condit',\n", " 'condition',\n", " 'conduct',\n", " 'confeder',\n", " 'confess',\n", " 'confid',\n", " 'confin',\n", " 'conflict',\n", " 'confront',\n", " 'confus',\n", " 'congress',\n", " 'conman',\n", " 'connect',\n", " 'connecticut',\n", " 'connel',\n", " 'connor',\n", " 'conquer',\n", " 'consequ',\n", " 'consequences',\n", " 'conserv',\n", " 'consid',\n", " 'conspir',\n", " 'conspiraci',\n", " 'conspiracy',\n", " 'constant',\n", " 'constantli',\n", " 'construct',\n", " 'consum',\n", " 'contact',\n", " 'contain',\n", " 'contemporari',\n", " 'contend',\n", " 'content',\n", " 'contest',\n", " 'continu',\n", " 'contract',\n", " 'contractor',\n", " 'control',\n", " 'controversi',\n", " 'convent',\n", " 'converg',\n", " 'convers',\n", " 'convict',\n", " 'convinc',\n", " 'cook',\n", " ...]" ] }, "execution_count": 55, "metadata": {}, "output_type": "execute_result" } ], "source": [ "cv.get_feature_names()" ] }, { "cell_type": "code", "execution_count": 56, "id": "f51bfc22", "metadata": {}, "outputs": [], "source": [ "from sklearn.metrics.pairwise import cosine_similarity" ] }, { "cell_type": "code", "execution_count": 57, "id": "e1174a81", "metadata": {}, "outputs": [], "source": [ "similarity=cosine_similarity(vectors)" ] }, { "cell_type": "code", "execution_count": 58, "id": "f11e1682", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[(0, 0.9999999999999998),\n", " (1216, 0.2867696673382022),\n", " (2409, 0.26901379342448517),\n", " (3730, 0.2605130246476754),\n", " (507, 0.255608593705383),\n", " (539, 0.25038669783359574),\n", " (582, 0.24511108480187255),\n", " (1204, 0.24455799402225922),\n", " (1194, 0.2367785320221084),\n", " (61, 0.23179316248638276),\n", " (778, 0.23174488732966075),\n", " (4048, 0.2278389747471728),\n", " (1920, 0.2252817784447915),\n", " (2786, 0.21853668936906193),\n", " (172, 0.21239769762143662),\n", " (972, 0.2108663315950723),\n", " (322, 0.2105263157894737),\n", " (2333, 0.20443988269091462),\n", " (3608, 0.20437977982832192),\n", " (260, 0.20395079136182276),\n", " (151, 0.2029530274475215),\n", " (4192, 0.2029530274475215),\n", " (1444, 0.20277677641345318),\n", " (74, 0.20246457179963145),\n", " (1089, 0.2020475485519274),\n", " (3675, 0.1979082783981174),\n", " (973, 0.19767387315371682),\n", " (577, 0.1976738731537168),\n", " (47, 0.19672236884115843),\n", " (2971, 0.19252140716412977),\n", " (942, 0.19134594929397597),\n", " (495, 0.19088542889273336),\n", " (1201, 0.19088542889273336),\n", " (305, 0.19007487139298027),\n", " (4, 0.1892994097121204),\n", " (4405, 0.18731716231633883),\n", " (94, 0.1873171623163388),\n", " (27, 0.18693292157876878),\n", " (3327, 0.1860807318911967),\n", " (1275, 0.18394180184548975),\n", " (1329, 0.18394180184548975),\n", " (2999, 0.1813690625275029),\n", " (3999, 0.18074256993863339),\n", " (83, 0.17996850826633906),\n", " (1071, 0.17954621161490197),\n", " (220, 0.1777046633277277),\n", " (184, 0.177343107178349),\n", " (1321, 0.17699808135119718),\n", " (168, 0.17521916101261562),\n", " (2204, 0.17521916101261562),\n", " (4336, 0.17521916101261562),\n", " (931, 0.1748149640244195),\n", " (36, 0.17316974359835272),\n", " (373, 0.17292861596651865),\n", " (300, 0.17119059581558146),\n", " (3538, 0.17119059581558146),\n", " (3162, 0.170405729136922),\n", " (1982, 0.16943474841747153),\n", " (661, 0.16754156331667822),\n", " (529, 0.16742770563222897),\n", " (1831, 0.16742770563222897),\n", " (91, 0.16692446522239718),\n", " (41, 0.16563698349810535),\n", " (67, 0.16452254913212452),\n", " (150, 0.16426202236672155),\n", " (1537, 0.16222142113076252),\n", " (342, 0.16122923187750418),\n", " (595, 0.16059101370939324),\n", " (31, 0.15907119074394446),\n", " (2515, 0.15907119074394446),\n", " (1178, 0.15789473684210528),\n", " (4010, 0.15737789507292674),\n", " (2731, 0.15609763526361567),\n", " (149, 0.15511334686589626),\n", " (838, 0.1540171257313038),\n", " (26, 0.15389675281277312),\n", " (187, 0.15389675281277312),\n", " (1383, 0.152008377581442),\n", " (111, 0.15018785229652767),\n", " (1344, 0.15018785229652767),\n", " (311, 0.15018785229652765),\n", " (52, 0.14843120879858804),\n", " (513, 0.14843120879858804),\n", " (2075, 0.14808721943977307),\n", " (7, 0.14673479641335554),\n", " (2760, 0.14659886790209342),\n", " (127, 0.14601068654819696),\n", " (579, 0.14567913668701626),\n", " (581, 0.14567913668701626),\n", " (108, 0.14509525002200235),\n", " (1297, 0.14509525002200235),\n", " (466, 0.14509525002200233),\n", " (1396, 0.14421498760030763),\n", " (1479, 0.1442149876003076),\n", " (1355, 0.14350946197048198),\n", " (1938, 0.14350946197048198),\n", " (275, 0.1433848336691011),\n", " (294, 0.1433848336691011),\n", " (3354, 0.1433848336691011),\n", " (1056, 0.1419745572840903),\n", " (1273, 0.1419745572840903),\n", " (490, 0.14159846508095775),\n", " (1488, 0.14159846508095775),\n", " (413, 0.1411956236812263),\n", " (2496, 0.1411956236812263),\n", " (461, 0.14119562368122626),\n", " (568, 0.14119562368122626),\n", " (95, 0.1404878717372541),\n", " (17, 0.13977653617040256),\n", " (46, 0.1391037210186643),\n", " (3409, 0.1391037210186643),\n", " (1965, 0.13872950617564817),\n", " (56, 0.13834289277321493),\n", " (249, 0.13834289277321493),\n", " (1327, 0.13834289277321493),\n", " (3781, 0.13834289277321493),\n", " (72, 0.13710212427677043),\n", " (843, 0.13710212427677043),\n", " (859, 0.13710212427677043),\n", " (2169, 0.13710212427677043),\n", " (4538, 0.13629325512727639),\n", " (476, 0.13530201829834768),\n", " (505, 0.13530201829834768),\n", " (668, 0.13530201829834768),\n", " (935, 0.13530201829834768),\n", " (3982, 0.13530201829834768),\n", " (1808, 0.1351845176089688),\n", " (4348, 0.13497638119975428),\n", " (1322, 0.13476498501489081),\n", " (158, 0.13369695534647594),\n", " (502, 0.13369695534647594),\n", " (777, 0.13369695534647594),\n", " (126, 0.13334518676566626),\n", " (1560, 0.13334518676566626),\n", " (1373, 0.1324532357065044),\n", " (2378, 0.1324532357065044),\n", " (2584, 0.1324532357065044),\n", " (4079, 0.13157894736842107),\n", " (2133, 0.13124359177794215),\n", " (1015, 0.12988108336653278),\n", " (2181, 0.12988108336653278),\n", " (3622, 0.12988108336653278),\n", " (134, 0.12977713690461004),\n", " (368, 0.12977713690461004),\n", " (1774, 0.12977713690461004),\n", " (2873, 0.12892051277806202),\n", " (14, 0.12824729401064427),\n", " (138, 0.12824729401064427),\n", " (369, 0.12824729401064427),\n", " (1086, 0.12824729401064427),\n", " (2686, 0.12824729401064427),\n", " (4230, 0.12824729401064427),\n", " (487, 0.12725695259515557),\n", " (773, 0.12725695259515557),\n", " (2970, 0.12725695259515557),\n", " (937, 0.126673647984535),\n", " (1741, 0.12565617248750865),\n", " (2480, 0.12565617248750865),\n", " (166, 0.12515654358043973),\n", " (754, 0.12515654358043973),\n", " (2450, 0.12515654358043973),\n", " (3628, 0.12515654358043973),\n", " (483, 0.12487810821089253),\n", " (1096, 0.12487810821089253),\n", " (1158, 0.12487810821089253),\n", " (2652, 0.12487810821089253),\n", " (102, 0.12462194771917919),\n", " (84, 0.12361284651454937),\n", " (208, 0.12262786789699316),\n", " (3376, 0.12262786789699316),\n", " (1878, 0.12262786789699313),\n", " (438, 0.12227899701112963),\n", " (557, 0.12227899701112963),\n", " (1299, 0.12227899701112961),\n", " (2331, 0.12166606584807191),\n", " (2674, 0.12166606584807191),\n", " (3083, 0.12166606584807191),\n", " (139, 0.12072654548783007),\n", " (68, 0.1204950466257556),\n", " (781, 0.1204950466257556),\n", " (1004, 0.1204950466257556),\n", " (1274, 0.1204950466257556),\n", " (1658, 0.1204950466257556),\n", " (1002, 0.11980845957463077),\n", " (549, 0.11959121830873498),\n", " (870, 0.11959121830873498),\n", " (900, 0.11959121830873498),\n", " (3235, 0.11959121830873498),\n", " (1047, 0.11846977555181847),\n", " (1833, 0.11846977555181847),\n", " (2060, 0.11846977555181847),\n", " (2741, 0.11846977555181847),\n", " (4673, 0.11846977555181847),\n", " (1673, 0.11803342130469506),\n", " (1715, 0.11803342130469506),\n", " (2789, 0.11803342130469506),\n", " (3721, 0.11803342130469506),\n", " (4000, 0.11803342130469506),\n", " (160, 0.11712303424679457),\n", " (454, 0.11707322644771176),\n", " (182, 0.11707322644771175),\n", " (278, 0.11707322644771175),\n", " (1617, 0.11707322644771175),\n", " (2284, 0.11707322644771175),\n", " (28, 0.116543309349613),\n", " (122, 0.116543309349613),\n", " (422, 0.116543309349613),\n", " (678, 0.116543309349613),\n", " (589, 0.1163350101494222),\n", " (2547, 0.11587244366483038),\n", " (1497, 0.11551284429847784),\n", " (3212, 0.11506355109724453),\n", " (189, 0.1147078669352809),\n", " (236, 0.11470786693528089),\n", " (1301, 0.11470786693528089),\n", " (1220, 0.11470786693528087),\n", " (85, 0.1141270638770543),\n", " (432, 0.11357771260606365),\n", " (1418, 0.11357771260606365),\n", " (50, 0.11295649894498101),\n", " (1616, 0.11295649894498101),\n", " (123, 0.1124803176664619),\n", " (420, 0.1124803176664619),\n", " (536, 0.1124803176664619),\n", " (889, 0.11243619908556624),\n", " (3147, 0.11239029738980326),\n", " (256, 0.11164843913471803),\n", " (808, 0.11164843913471803),\n", " (1348, 0.11164843913471803),\n", " (1575, 0.11164843913471803),\n", " (2372, 0.11141412945539662),\n", " (3309, 0.11141412945539662),\n", " (1512, 0.11141412945539661),\n", " (87, 0.11128297681493143),\n", " (121, 0.11128297681493143),\n", " (232, 0.11128297681493143),\n", " (4468, 0.11128297681493143),\n", " (206, 0.11092107999698035),\n", " (238, 0.11092107999698035),\n", " (228, 0.11037769642208699),\n", " (81, 0.11020775375559676),\n", " (1574, 0.11020775375559676),\n", " (3428, 0.10968169942141637),\n", " (21, 0.10968169942141635),\n", " (449, 0.10968169942141635),\n", " (1031, 0.10968169942141635),\n", " (1945, 0.10968169942141635),\n", " (2148, 0.10968169942141635),\n", " (3008, 0.10968169942141635),\n", " (692, 0.10936965981495178),\n", " (200, 0.10882143751650175),\n", " (627, 0.10882143751650175),\n", " (653, 0.10882143751650175),\n", " (1524, 0.10882143751650175),\n", " (307, 0.10876595882948199),\n", " (5, 0.10838874619051501),\n", " (740, 0.10838874619051501),\n", " (3093, 0.10838874619051501),\n", " (3630, 0.10838874619051501),\n", " (786, 0.10814761408717503),\n", " (3498, 0.10814761408717503),\n", " (4777, 0.10814761408717502),\n", " (229, 0.1074861545850028),\n", " (572, 0.10743376064838502),\n", " (939, 0.1068366854693644),\n", " (332, 0.106676149412533),\n", " (472, 0.106676149412533),\n", " (1237, 0.106676149412533),\n", " (170, 0.10650358071057624),\n", " (262, 0.10650358071057624),\n", " (1166, 0.10619884881071831),\n", " (1501, 0.10619884881071831),\n", " (1745, 0.10619884881071831),\n", " (2161, 0.10619884881071831),\n", " (2634, 0.10619884881071831),\n", " (4135, 0.10619884881071831),\n", " (467, 0.10559715077387793),\n", " (541, 0.10559715077387793),\n", " (1496, 0.10559715077387793),\n", " (131, 0.10526315789473685),\n", " (295, 0.10526315789473685),\n", " (2072, 0.10526315789473685),\n", " (3340, 0.10526315789473685),\n", " (2498, 0.10471347707292389),\n", " (75, 0.10390486669322622),\n", " (223, 0.10390486669322622),\n", " (687, 0.10390486669322622),\n", " (814, 0.10390486669322622),\n", " (1195, 0.10390486669322622),\n", " (1771, 0.10390486669322622),\n", " (2817, 0.10390486669322622),\n", " (654, 0.10385162309931599),\n", " (2439, 0.10385162309931599),\n", " (105, 0.1037571695799112),\n", " (233, 0.1037571695799112),\n", " (624, 0.1037571695799112),\n", " (2323, 0.1037571695799112),\n", " (2456, 0.1037571695799112),\n", " (2521, 0.1037571695799112),\n", " (3055, 0.1037571695799112),\n", " (3621, 0.1037571695799112),\n", " (3839, 0.1037571695799112),\n", " (1455, 0.10301070542879115),\n", " (10, 0.10259783520851541),\n", " (1082, 0.10259783520851541),\n", " (3152, 0.10259783520851541),\n", " (3634, 0.10259783520851541),\n", " (3755, 0.10259783520851541),\n", " (3874, 0.10259783520851541),\n", " (4097, 0.10259783520851541),\n", " (2106, 0.10218988991416095),\n", " (2762, 0.10147651372376076),\n", " (3663, 0.10147651372376076),\n", " (3954, 0.10147651372376076),\n", " (3441, 0.10138838820672659),\n", " (508, 0.101338918387628),\n", " (1294, 0.101338918387628),\n", " (2247, 0.10133891838762799),\n", " (1405, 0.10060545457319173),\n", " (1439, 0.10060545457319173),\n", " (2099, 0.10060545457319173),\n", " (312, 0.10012523486435178),\n", " (330, 0.10012523486435178),\n", " (643, 0.10012523486435178),\n", " (988, 0.10012523486435178),\n", " (1037, 0.10012523486435178),\n", " (1614, 0.10012523486435178),\n", " (35, 0.09933992677987831),\n", " (157, 0.09933992677987831),\n", " (319, 0.09933992677987831),\n", " (325, 0.09933992677987831),\n", " (715, 0.09933992677987831),\n", " (1077, 0.09933992677987831),\n", " (1280, 0.09933992677987831),\n", " (1884, 0.09933992677987831),\n", " (2053, 0.09933992677987831),\n", " (4018, 0.09933992677987831),\n", " (4198, 0.09933992677987831),\n", " (4490, 0.09933992677987831),\n", " (363, 0.09909250441117726),\n", " (491, 0.09909250441117726),\n", " (266, 0.0989541391990587),\n", " (445, 0.0989541391990587),\n", " (510, 0.0989541391990587),\n", " (3620, 0.0989541391990587),\n", " (3783, 0.0989541391990587),\n", " (3935, 0.0989541391990587),\n", " (1775, 0.09836118442057921),\n", " (410, 0.09782319760890369),\n", " (480, 0.09782319760890369),\n", " (535, 0.09782319760890369),\n", " (898, 0.09782319760890369),\n", " (1109, 0.09782319760890369),\n", " (1401, 0.09782319760890369),\n", " (1823, 0.09782319760890369),\n", " (2253, 0.09782319760890369),\n", " (33, 0.09733285267845754),\n", " (148, 0.09733285267845754),\n", " (263, 0.09733285267845754),\n", " (878, 0.09733285267845754),\n", " (1156, 0.09733285267845754),\n", " (1727, 0.09733285267845754),\n", " (1942, 0.09733285267845754),\n", " (2787, 0.09733285267845754),\n", " (4256, 0.09733285267845754),\n", " (4403, 0.09733285267845754),\n", " (4472, 0.09733285267845754),\n", " (9, 0.0967301666813349),\n", " (334, 0.0967301666813349),\n", " (371, 0.09567297464698798),\n", " (412, 0.09567297464698798),\n", " (2241, 0.09567297464698798),\n", " (2556, 0.09567297464698798),\n", " (4545, 0.09558988911273408),\n", " (362, 0.09544271444636668),\n", " (791, 0.09544271444636668),\n", " (1573, 0.09544271444636668),\n", " (2562, 0.09544271444636668),\n", " (4203, 0.09544271444636668),\n", " (18, 0.09493290614465533),\n", " (11, 0.09464970485606021),\n", " (587, 0.09464970485606021),\n", " (1276, 0.09365858115816941),\n", " (1357, 0.09365858115816941),\n", " (3720, 0.09365858115816941),\n", " (4502, 0.09365858115816941),\n", " (660, 0.0936585811581694),\n", " (920, 0.0936585811581694),\n", " (980, 0.0936585811581694),\n", " (1474, 0.0936585811581694),\n", " (1686, 0.0936585811581694),\n", " (1692, 0.0936585811581694),\n", " (1721, 0.0936585811581694),\n", " (2396, 0.0936585811581694),\n", " (2488, 0.0936585811581694),\n", " (2592, 0.0936585811581694),\n", " (2645, 0.0936585811581694),\n", " (2650, 0.0936585811581694),\n", " (2820, 0.0936585811581694),\n", " (3537, 0.0936585811581694),\n", " (4331, 0.0936585811581694),\n", " (301, 0.09365858115816939),\n", " (129, 0.0926979549318643),\n", " (243, 0.0926979549318643),\n", " (279, 0.0926979549318643),\n", " (473, 0.0926979549318643),\n", " (596, 0.0926979549318643),\n", " (813, 0.0926979549318643),\n", " (1446, 0.0926979549318643),\n", " (1701, 0.0926979549318643),\n", " (3407, 0.0926979549318643),\n", " (785, 0.09243423333081695),\n", " (219, 0.09197090092274487),\n", " (244, 0.09197090092274487),\n", " (511, 0.09197090092274487),\n", " (1756, 0.09197090092274487),\n", " (2093, 0.09197090092274487),\n", " (2651, 0.09197090092274487),\n", " (3736, 0.09197090092274487),\n", " (230, 0.09183979479633063),\n", " (799, 0.09183979479633063),\n", " (239, 0.09125667909262308),\n", " (2570, 0.09125667909262308),\n", " (43, 0.09086217008485092),\n", " (602, 0.09086217008485092),\n", " (997, 0.09086217008485092),\n", " (1233, 0.09086217008485092),\n", " (1846, 0.09086217008485092),\n", " (3881, 0.09086217008485092),\n", " (12, 0.09037128496931669),\n", " (88, 0.09037128496931669),\n", " (167, 0.09037128496931669),\n", " (356, 0.09037128496931669),\n", " (400, 0.09037128496931669),\n", " (1306, 0.09037128496931669),\n", " (1480, 0.09037128496931669),\n", " (2251, 0.09037128496931669),\n", " (2957, 0.09037128496931669),\n", " (331, 0.08998425413316952),\n", " (2363, 0.08998425413316952),\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", " (1906, 0.0891313035643173),\n", " (2115, 0.08903057122447033),\n", " (292, 0.08885233166386385),\n", " (564, 0.08885233166386385),\n", " (1027, 0.08885233166386385),\n", " (2660, 0.08885233166386385),\n", " (2868, 0.08885233166386385),\n", " (3322, 0.08885233166386385),\n", " (169, 0.08830215713766959),\n", " (270, 0.08830215713766959),\n", " (618, 0.08830215713766959),\n", " (1783, 0.08830215713766959),\n", " (2109, 0.08830215713766959),\n", " (2713, 0.08830215713766959),\n", " (2740, 0.08830215713766959),\n", " (3553, 0.08830215713766959),\n", " (479, 0.08797691788472335),\n", " (752, 0.08749572785196143),\n", " (1832, 0.08749572785196143),\n", " (2448, 0.08746392856766495),\n", " (23, 0.08740748201220976),\n", " (141, 0.08740748201220976),\n", " (389, 0.08740748201220976),\n", " (745, 0.08740748201220976),\n", " (794, 0.08740748201220976),\n", " (960, 0.08740748201220976),\n", " (1249, 0.08740748201220976),\n", " (1259, 0.08740748201220976),\n", " (3448, 0.08740748201220976),\n", " (3449, 0.08740748201220976),\n", " (143, 0.08671099695241201),\n", " (199, 0.08671099695241201),\n", " (827, 0.08671099695241201),\n", " (1530, 0.08671099695241201),\n", " (2880, 0.08671099695241201),\n", " (3556, 0.08671099695241201),\n", " (4516, 0.08671099695241201),\n", " (4587, 0.08671099695241201),\n", " (2, 0.08603090020146066),\n", " (457, 0.08603090020146066),\n", " (775, 0.08603090020146066),\n", " (1378, 0.08603090020146066),\n", " (2583, 0.08603090020146066),\n", " (3135, 0.08603090020146066),\n", " (4754, 0.08603090020146066),\n", " (234, 0.08594700851870801),\n", " (1019, 0.08594700851870801),\n", " (2354, 0.08594700851870801),\n", " (32, 0.08520286456846099),\n", " (217, 0.08520286456846099),\n", " (142, 0.08471737420873576),\n", " (894, 0.08471737420873576),\n", " (1097, 0.08471737420873576),\n", " (1142, 0.08471737420873576),\n", " (1589, 0.08471737420873576),\n", " (2304, 0.08471737420873576),\n", " (4560, 0.08471737420873576),\n", " (48, 0.08447772061910234),\n", " (190, 0.08447772061910234),\n", " (1305, 0.08447772061910234),\n", " (1639, 0.08447772061910234),\n", " (2968, 0.08447772061910234),\n", " (62, 0.0837707816583391),\n", " (381, 0.0837707816583391),\n", " (534, 0.0837707816583391),\n", " (1698, 0.0837707816583391),\n", " (3180, 0.0837707816583391),\n", " (3218, 0.0837707816583391),\n", " (3978, 0.0837707816583391),\n", " (4737, 0.0837707816583391),\n", " (1, 0.08346223261119858),\n", " (152, 0.08346223261119858),\n", " (203, 0.08346223261119858),\n", " (315, 0.08346223261119858),\n", " (547, 0.08346223261119858),\n", " (1688, 0.08346223261119858),\n", " (2128, 0.08346223261119858),\n", " (2386, 0.08321783316232578),\n", " (19, 0.0830812984794528),\n", " (403, 0.0830812984794528),\n", " (3905, 0.0830812984794528),\n", " (45, 0.08240856434303293),\n", " (2203, 0.08240856434303293),\n", " (39, 0.08226127456606226),\n", " (227, 0.08226127456606226),\n", " (341, 0.08226127456606226),\n", " (626, 0.08226127456606226),\n", " (787, 0.08226127456606226),\n", " (1207, 0.08226127456606226),\n", " (1749, 0.08226127456606226),\n", " (2167, 0.08226127456606226),\n", " (2661, 0.08226127456606226),\n", " (3140, 0.08226127456606226),\n", " (3301, 0.08226127456606226),\n", " (3470, 0.08226127456606226),\n", " (63, 0.08175191193132876),\n", " (501, 0.08175191193132876),\n", " (38, 0.08111071056538127),\n", " (242, 0.08111071056538127),\n", " (245, 0.08111071056538127),\n", " (306, 0.08111071056538127),\n", " (584, 0.08111071056538127),\n", " (812, 0.08111071056538127),\n", " (866, 0.08111071056538127),\n", " (901, 0.08111071056538127),\n", " (1269, 0.08111071056538127),\n", " (1519, 0.08111071056538127),\n", " (1664, 0.08111071056538127),\n", " (2339, 0.08111071056538127),\n", " (2644, 0.08111071056538127),\n", " (2671, 0.08111071056538127),\n", " (2865, 0.08111071056538127),\n", " (2877, 0.08111071056538127),\n", " (3527, 0.08111071056538127),\n", " (3926, 0.08111071056538127),\n", " (4492, 0.08111071056538127),\n", " (4568, 0.08111071056538127),\n", " (4626, 0.08111071056538127),\n", " (4641, 0.08111071056538127),\n", " (4654, 0.08111071056538127),\n", " (4657, 0.08111071056538127),\n", " (51, 0.08048436365855338),\n", " (164, 0.08000711205939975),\n", " (854, 0.08000711205939975),\n", " (899, 0.08000711205939975),\n", " (1325, 0.08000711205939975),\n", " (1747, 0.08000711205939975),\n", " (2683, 0.08000711205939975),\n", " (3764, 0.08000711205939975),\n", " (3816, 0.08000711205939975),\n", " (3851, 0.08000711205939975),\n", " (486, 0.07992075789278004),\n", " (103, 0.07987230638308718),\n", " (222, 0.07987230638308718),\n", " (1534, 0.07987230638308718),\n", " (2792, 0.07987230638308718),\n", " (4506, 0.07987230638308718),\n", " (1898, 0.0792740035289418),\n", " (16, 0.07894736842105264),\n", " (37, 0.07894736842105264),\n", " (241, 0.07894736842105264),\n", " (329, 0.07894736842105264),\n", " (1080, 0.07894736842105264),\n", " (1161, 0.07894736842105264),\n", " (2295, 0.07894736842105264),\n", " (3233, 0.07894736842105264),\n", " (4316, 0.07894736842105264),\n", " (193, 0.07878168645790681),\n", " (153, 0.07868894753646337),\n", " (776, 0.07868894753646337),\n", " (1045, 0.07868894753646337),\n", " (1828, 0.07868894753646337),\n", " (1926, 0.07868894753646337),\n", " (3728, 0.07868894753646337),\n", " (3832, 0.07868894753646337),\n", " (4279, 0.07868894753646337),\n", " (4473, 0.07868894753646337),\n", " (125, 0.07843304784240032),\n", " (286, 0.0781166566864507),\n", " (1659, 0.0781166566864507),\n", " (174, 0.07792865001991967),\n", " (402, 0.07792865001991967),\n", " (922, 0.07792865001991967),\n", " (1113, 0.07792865001991967),\n", " (2938, 0.07792865001991967),\n", " (3028, 0.07792865001991967),\n", " (3091, 0.07792865001991967),\n", " (3102, 0.07792865001991967),\n", " (3164, 0.07792865001991967),\n", " (4341, 0.07792865001991967),\n", " (1924, 0.07755667343294813),\n", " (3560, 0.07755667343294813),\n", " (1282, 0.0770085628656519),\n", " (40, 0.07694837640638656),\n", " (96, 0.07694837640638656),\n", " (101, 0.07694837640638656),\n", " (112, 0.07694837640638656),\n", " (207, 0.07694837640638656),\n", " (632, 0.07694837640638656),\n", " (737, 0.07694837640638656),\n", " (1289, 0.07694837640638656),\n", " (2219, 0.07694837640638656),\n", " (4268, 0.07694837640638656),\n", " (4624, 0.07694837640638656),\n", " (850, 0.07647191129018727),\n", " (1005, 0.07647191129018727),\n", " (1139, 0.07647191129018727),\n", " (1254, 0.07647191129018727),\n", " (1621, 0.07647191129018727),\n", " (2165, 0.07647191129018727),\n", " (2274, 0.07647191129018727),\n", " (2712, 0.07647191129018727),\n", " (3430, 0.07647191129018727),\n", " (4165, 0.07647191129018727),\n", " (70, 0.076004188790721),\n", " (82, 0.076004188790721),\n", " (235, 0.076004188790721),\n", " (349, 0.076004188790721),\n", " (492, 0.076004188790721),\n", " (1290, 0.076004188790721),\n", " (1523, 0.076004188790721),\n", " (2449, 0.076004188790721),\n", " (2916, 0.076004188790721),\n", " (4558, 0.076004188790721),\n", " (246, 0.07594632491572426),\n", " (2005, 0.07543142864047142),\n", " (3331, 0.07530940414109724),\n", " (98, 0.07509392614826384),\n", " (210, 0.07509392614826384),\n", " (361, 0.07509392614826384),\n", " (365, 0.07509392614826384),\n", " (503, 0.07509392614826384),\n", " (540, 0.07509392614826384),\n", " (680, 0.07509392614826384),\n", " (1009, 0.07509392614826384),\n", " (1293, 0.07509392614826384),\n", " (2163, 0.07509392614826384),\n", " (4045, 0.07509392614826384),\n", " (4205, 0.07509392614826384),\n", " (2256, 0.07492686492653551),\n", " (205, 0.07443229275647868),\n", " (800, 0.07443229275647868),\n", " (995, 0.07443229275647868),\n", " (1323, 0.07443229275647868),\n", " (1521, 0.07443229275647868),\n", " (1770, 0.07443229275647868),\n", " (2326, 0.07443229275647868),\n", " (2551, 0.07443229275647868),\n", " (2801, 0.07443229275647868),\n", " (3069, 0.07443229275647868),\n", " (3117, 0.07443229275647868),\n", " (3126, 0.07443229275647868),\n", " (4011, 0.07443229275647868),\n", " (4412, 0.07443229275647868),\n", " (4542, 0.07443229275647868),\n", " (634, 0.07421560439929402),\n", " (885, 0.07421560439929402),\n", " (1070, 0.07421560439929402),\n", " (2395, 0.07421560439929402),\n", " (3701, 0.07421560439929402),\n", " (1990, 0.07394738666465357),\n", " (2190, 0.07394738666465357),\n", " (3431, 0.07394738666465357),\n", " (3, 0.0734718358370645),\n", " (1487, 0.0734718358370645),\n", " (71, 0.07336739820667777),\n", " (908, 0.07336739820667777),\n", " (1367, 0.07336739820667777),\n", " (1623, 0.07336739820667777),\n", " (2021, 0.07336739820667777),\n", " (2056, 0.07336739820667777),\n", " (3022, 0.07336739820667777),\n", " (3285, 0.07336739820667777),\n", " (3805, 0.07336739820667777),\n", " (728, 0.07254762501100118),\n", " (833, 0.07254762501100118),\n", " (979, 0.07254762501100118),\n", " (1765, 0.07254762501100118),\n", " (1996, 0.07254762501100118),\n", " (2988, 0.07254762501100118),\n", " (3255, 0.07254762501100118),\n", " (3355, 0.07254762501100118),\n", " (4640, 0.07254762501100118),\n", " (59, 0.07254762501100116),\n", " (179, 0.07254762501100116),\n", " (1489, 0.07254762501100116),\n", " (1655, 0.07254762501100116),\n", " (2114, 0.07254762501100116),\n", " (2212, 0.07254762501100116),\n", " (2297, 0.07254762501100116),\n", " (2317, 0.07254762501100116),\n", " (2381, 0.07254762501100116),\n", " (2479, 0.07254762501100116),\n", " (2772, 0.07254762501100116),\n", " (3072, 0.07254762501100116),\n", " (3103, 0.07254762501100116),\n", " (3155, 0.07254762501100116),\n", " (3483, 0.07254762501100116),\n", " (3716, 0.07254762501100116),\n", " (3976, 0.07254762501100116),\n", " (4431, 0.07254762501100116),\n", " (4443, 0.07254762501100116),\n", " (790, 0.07209840939145001),\n", " (1959, 0.07209840939145001),\n", " (76, 0.07175473098524099),\n", " (784, 0.07175473098524099),\n", " (932, 0.07175473098524099),\n", " (933, 0.07175473098524099),\n", " (1168, 0.07175473098524099),\n", " (1883, 0.07175473098524099),\n", " (2701, 0.07175473098524099),\n", " (2852, 0.07175473098524099),\n", " (2903, 0.07175473098524099),\n", " (3305, 0.07175473098524099),\n", " (3423, 0.07175473098524099),\n", " (3464, 0.07175473098524099),\n", " (4083, 0.07175473098524099),\n", " (86, 0.07098727864204515),\n", " (93, 0.07098727864204515),\n", " (175, 0.07098727864204515),\n", " (271, 0.07098727864204515),\n", " (543, 0.07098727864204515),\n", " (674, 0.07098727864204515),\n", " (1145, 0.07098727864204515),\n", " (1340, 0.07098727864204515),\n", " (2831, 0.07098727864204515),\n", " (3206, 0.07098727864204515),\n", " (3611, 0.07098727864204515),\n", " (4483, 0.07098727864204515),\n", " (1240, 0.07079923254047887),\n", " (1410, 0.07079923254047887),\n", " (2445, 0.07079923254047887),\n", " (2763, 0.07079923254047887),\n", " (2854, 0.07079923254047887),\n", " (3223, 0.07079923254047887),\n", " (4638, 0.07079923254047887),\n", " (55, 0.07038153430777869),\n", " (183, 0.07038153430777869),\n", " (1632, 0.07024393586862705),\n", " (1847, 0.07024393586862705),\n", " (3485, 0.07024393586862705),\n", " (97, 0.06952346619889822),\n", " (254, 0.06952346619889822),\n", " (302, 0.06952346619889822),\n", " (782, 0.06952346619889822),\n", " (1146, 0.06952346619889822),\n", " (1457, 0.06952346619889822),\n", " (2103, 0.06952346619889822),\n", " (3300, 0.06952346619889822),\n", " (3907, 0.06952346619889822),\n", " (4180, 0.06952346619889822),\n", " (336, 0.06917144638660747),\n", " (1737, 0.06917144638660747),\n", " (2533, 0.06917144638660747),\n", " (3891, 0.06917144638660747),\n", " (4290, 0.06917144638660747),\n", " (419, 0.06882472016116853),\n", " (600, 0.06882472016116853),\n", " (1278, 0.06882472016116853),\n", " (2002, 0.06882472016116853),\n", " (2018, 0.06882472016116853),\n", " (2209, 0.06882472016116853),\n", " (2243, 0.06882472016116853),\n", " (665, 0.06814662756363819),\n", " (671, 0.06814662756363819),\n", " (704, 0.06814662756363819),\n", " (732, 0.06814662756363819),\n", " (1538, 0.06814662756363819),\n", " (2035, 0.06814662756363819),\n", " (3020, 0.06814662756363819),\n", " (3310, 0.06814662756363819),\n", " (3588, 0.06814662756363819),\n", " (4123, 0.06814662756363819),\n", " (4392, 0.06814662756363819),\n", " (100, 0.06765100914917384),\n", " (209, 0.06765100914917384),\n", " (308, 0.06765100914917384),\n", " (498, 0.06765100914917384),\n", " (537, 0.06765100914917384),\n", " (570, 0.06765100914917384),\n", " (1292, 0.06765100914917384),\n", " (1466, 0.06765100914917384),\n", " (1860, 0.06765100914917384),\n", " (2218, 0.06765100914917384),\n", " (2435, 0.06765100914917384),\n", " (2622, 0.06765100914917384),\n", " (2664, 0.06765100914917384),\n", " (2743, 0.06765100914917384),\n", " (3398, 0.06765100914917384),\n", " (3678, 0.06765100914917384),\n", " (4216, 0.06765100914917384),\n", " (58, 0.06748819059987714),\n", " (124, 0.06748819059987714),\n", " (1445, 0.06748819059987714),\n", " (2305, 0.06748819059987714),\n", " (3225, 0.06748819059987714),\n", " (3910, 0.06748819059987714),\n", " (1634, 0.0672863110252489),\n", " (30, 0.06684847767323797),\n", " (734, 0.06684847767323797),\n", " (735, 0.06684847767323797),\n", " (3879, 0.06684847767323797),\n", " (488, 0.06657426652986062),\n", " (22, 0.0662266178532522),\n", " (237, 0.0662266178532522),\n", " (604, 0.0662266178532522),\n", " (695, 0.0662266178532522),\n", " (1085, 0.0662266178532522),\n", " (1171, 0.0662266178532522),\n", " (1381, 0.0662266178532522),\n", " (2250, 0.0662266178532522),\n", " (2259, 0.0662266178532522),\n", " (2890, 0.0662266178532522),\n", " (2976, 0.0662266178532522),\n", " (3241, 0.0662266178532522),\n", " (3412, 0.0662266178532522),\n", " (3994, 0.0662266178532522),\n", " (4061, 0.0662266178532522),\n", " (4351, 0.0662266178532522),\n", " (212, 0.06622661785325219),\n", " (215, 0.06622661785325219),\n", " (635, 0.06622661785325219),\n", " (1018, 0.06622661785325219),\n", " (1087, 0.06622661785325219),\n", " (1121, 0.06622661785325219),\n", " (1432, 0.06622661785325219),\n", " (2302, 0.06622661785325219),\n", " (2320, 0.06622661785325219),\n", " (2657, 0.06622661785325219),\n", " (304, 0.06578947368421054),\n", " (1175, 0.06562179588897107),\n", " (2003, 0.06562179588897107),\n", " (2135, 0.06562179588897107),\n", " (2404, 0.06562179588897107),\n", " (2596, 0.06562179588897107),\n", " (3390, 0.06562179588897107),\n", " (3635, 0.06562179588897107),\n", " (4019, 0.06554735253444621),\n", " (2832, 0.06521546507260247),\n", " (29, 0.065033247714309),\n", " (281, 0.065033247714309),\n", " (1531, 0.065033247714309),\n", " (2052, 0.065033247714309),\n", " (3822, 0.065033247714309),\n", " (109, 0.06488856845230502),\n", " (216, 0.06488856845230502),\n", " (267, 0.06488856845230502),\n", " (621, 0.06488856845230502),\n", " (744, 0.06488856845230502),\n", " (1068, 0.06488856845230502),\n", " (1076, 0.06488856845230502),\n", " (1438, 0.06488856845230502),\n", " (1486, 0.06488856845230502),\n", " (2268, 0.06488856845230502),\n", " (2270, 0.06488856845230502),\n", " (2309, 0.06488856845230502),\n", " (2579, 0.06488856845230502),\n", " (2715, 0.06488856845230502),\n", " (2882, 0.06488856845230502),\n", " (3181, 0.06488856845230502),\n", " (3374, 0.06488856845230502),\n", " (3572, 0.06488856845230502),\n", " (3901, 0.06488856845230502),\n", " (3929, 0.06488856845230502),\n", " (4623, 0.06488856845230502),\n", " (447, 0.06446025638903101),\n", " (746, 0.06446025638903101),\n", " (1011, 0.06446025638903101),\n", " (1848, 0.06446025638903101),\n", " (3174, 0.06446025638903101),\n", " (2519, 0.06424925662032356),\n", " (425, 0.06390214842634574),\n", " (443, 0.06390214842634574),\n", " (471, 0.06390214842634574),\n", " (1979, 0.06390214842634574),\n", " (2264, 0.06390214842634574),\n", " (2527, 0.06390214842634574),\n", " (159, 0.06362847629757779),\n", " (290, 0.06362847629757779),\n", " (546, 0.06362847629757779),\n", " (951, 0.06362847629757779),\n", " (1262, 0.06362847629757779),\n", " (1304, 0.06362847629757779),\n", " (1365, 0.06362847629757779),\n", " (1707, 0.06362847629757779),\n", " (1854, 0.06362847629757779),\n", " (1950, 0.06362847629757779),\n", " (2113, 0.06362847629757779),\n", " (2228, 0.06362847629757779),\n", " (3118, 0.06362847629757779),\n", " (3133, 0.06362847629757779),\n", " (3253, 0.06362847629757779),\n", " (3931, 0.06362847629757779),\n", " (4006, 0.06362847629757779),\n", " (4312, 0.06362847629757779),\n", " (4355, 0.06362847629757779),\n", " (4704, 0.06362847629757779),\n", " (612, 0.06335829046432676),\n", " (1093, 0.06335829046432676),\n", " (1462, 0.06335829046432676),\n", " (3344, 0.06335829046432676),\n", " (3740, 0.06335829046432676),\n", " (15, 0.06282808624375433),\n", " (253, 0.06282808624375433),\n", " (591, 0.06282808624375433),\n", " (2319, 0.06282808624375433),\n", " (3298, 0.06282808624375433),\n", " (3607, 0.06282808624375433),\n", " (276, 0.06243905410544627),\n", " (309, 0.06243905410544627),\n", " (957, 0.06243905410544627),\n", " (1605, 0.06243905410544627),\n", " (1606, 0.06243905410544627),\n", " (1944, 0.06243905410544627),\n", " (2600, 0.06243905410544627),\n", " (2948, 0.06243905410544627),\n", " (3834, 0.06243905410544627),\n", " (4357, 0.06243905410544627),\n", " (79, 0.06231097385958959),\n", " (92, 0.06231097385958959),\n", " (106, 0.06231097385958959),\n", " (963, 0.06231097385958959),\n", " (1030, 0.06231097385958959),\n", " (1191, 0.06231097385958959),\n", " (1202, 0.06231097385958959),\n", " (2520, 0.06231097385958959),\n", " (2888, 0.06231097385958959),\n", " (107, 0.061806423257274694),\n", " (836, 0.061806423257274694),\n", " (3078, 0.061806423257274694),\n", " (90, 0.06131393394849658),\n", " (154, 0.06131393394849658),\n", " (259, 0.06131393394849658),\n", " (348, 0.06131393394849658),\n", " (404, 0.06131393394849658),\n", " (615, 0.06131393394849658),\n", " (863, 0.06131393394849658),\n", " (945, 0.06131393394849658),\n", " (1147, 0.06131393394849658),\n", " (1347, 0.06131393394849658),\n", " (1584, 0.06131393394849658),\n", " (1607, 0.06131393394849658),\n", " (2090, 0.06131393394849658),\n", " (2120, 0.06131393394849658),\n", " (2127, 0.06131393394849658),\n", " (2538, 0.06131393394849658),\n", " (2620, 0.06131393394849658),\n", " (3240, 0.06131393394849658),\n", " (3770, 0.06131393394849658),\n", " (4196, 0.06131393394849658),\n", " (4320, 0.06131393394849658),\n", " (4566, 0.06131393394849658),\n", " (4652, 0.06131393394849658),\n", " (4664, 0.06131393394849658),\n", " (375, 0.061313933948496574),\n", " (733, 0.061313933948496574),\n", " (768, 0.061313933948496574),\n", " (1103, 0.061313933948496574),\n", " (224, 0.060833032924035954),\n", " (455, 0.060833032924035954),\n", " (3777, 0.060833032924035954),\n", " (4789, 0.060833032924035954),\n", " (1356, 0.060363272743915036),\n", " (358, 0.0602475233128778),\n", " (533, 0.0602475233128778),\n", " (664, 0.0602475233128778),\n", " (993, 0.0602475233128778),\n", " (998, 0.0602475233128778),\n", " (1064, 0.0602475233128778),\n", " (1092, 0.0602475233128778),\n", " (1312, 0.0602475233128778),\n", " (1408, 0.0602475233128778),\n", " ...]" ] }, "execution_count": 58, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sorted(list(enumerate(similarity[0])),reverse=True,key=lambda x:x[1])" ] }, { "cell_type": "code", "execution_count": 59, "id": "468b67c3", "metadata": {}, "outputs": [], "source": [ "def recommend(movie):\n", " index = new_df[new_df['title'] == movie].index[0]\n", " distances = sorted(list(enumerate(similarity[index])),reverse=True,key = lambda x: x[1])\n", " for i in distances[1:6]:\n", " print(new_df.iloc[i[0]].title)" ] }, { "cell_type": "code", "execution_count": 60, "id": "43bdd6e2", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Aliens vs Predator: Requiem\n", "Aliens\n", "Falcon Rising\n", "Independence Day\n", "Titan A.E.\n" ] } ], "source": [ "recommend('Avatar')" ] }, { "cell_type": "code", "execution_count": 61, "id": "e39326cd", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The Dark Knight\n", "Batman\n", "Batman\n", "The Dark Knight Rises\n", "10th & Wolf\n" ] } ], "source": [ "recommend('Batman Begins')" ] }, { "cell_type": "code", "execution_count": null, "id": "95c2b172", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.12" } }, "nbformat": 4, "nbformat_minor": 5 }