{ "cells": [ { "cell_type": "code", "execution_count": 50, "id": "714ff7ac", "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import pandas as pd" ] }, { "cell_type": "code", "execution_count": 51, "id": "1bb732cd", "metadata": {}, "outputs": [], "source": [ "movies = pd.read_csv(\"tmdb_5000_movies.csv\")\n", "credits = pd.read_csv('tmdb_5000_credits.csv')" ] }, { "cell_type": "code", "execution_count": 52, "id": "797513a7", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | budget | \n", "genres | \n", "homepage | \n", "id | \n", "keywords | \n", "original_language | \n", "original_title | \n", "overview | \n", "popularity | \n", "production_companies | \n", "production_countries | \n", "release_date | \n", "revenue | \n", "runtime | \n", "spoken_languages | \n", "status | \n", "tagline | \n", "title | \n", "vote_average | \n", "vote_count | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "237000000 | \n", "[{\"id\": 28, \"name\": \"Action\"}, {\"id\": 12, \"nam... | \n", "http://www.avatarmovie.com/ | \n", "19995 | \n", "[{\"id\": 1463, \"name\": \"culture clash\"}, {\"id\":... | \n", "en | \n", "Avatar | \n", "In the 22nd century, a paraplegic Marine is di... | \n", "150.437577 | \n", "[{\"name\": \"Ingenious Film Partners\", \"id\": 289... | \n", "[{\"iso_3166_1\": \"US\", \"name\": \"United States o... | \n", "2009-12-10 | \n", "2787965087 | \n", "162.0 | \n", "[{\"iso_639_1\": \"en\", \"name\": \"English\"}, {\"iso... | \n", "Released | \n", "Enter the World of Pandora. | \n", "Avatar | \n", "7.2 | \n", "11800 | \n", "
1 | \n", "300000000 | \n", "[{\"id\": 12, \"name\": \"Adventure\"}, {\"id\": 14, \"... | \n", "http://disney.go.com/disneypictures/pirates/ | \n", "285 | \n", "[{\"id\": 270, \"name\": \"ocean\"}, {\"id\": 726, \"na... | \n", "en | \n", "Pirates of the Caribbean: At World's End | \n", "Captain Barbossa, long believed to be dead, ha... | \n", "139.082615 | \n", "[{\"name\": \"Walt Disney Pictures\", \"id\": 2}, {\"... | \n", "[{\"iso_3166_1\": \"US\", \"name\": \"United States o... | \n", "2007-05-19 | \n", "961000000 | \n", "169.0 | \n", "[{\"iso_639_1\": \"en\", \"name\": \"English\"}] | \n", "Released | \n", "At the end of the world, the adventure begins. | \n", "Pirates of the Caribbean: At World's End | \n", "6.9 | \n", "4500 | \n", "
2 | \n", "245000000 | \n", "[{\"id\": 28, \"name\": \"Action\"}, {\"id\": 12, \"nam... | \n", "http://www.sonypictures.com/movies/spectre/ | \n", "206647 | \n", "[{\"id\": 470, \"name\": \"spy\"}, {\"id\": 818, \"name... | \n", "en | \n", "Spectre | \n", "A cryptic message from Bond’s past sends him o... | \n", "107.376788 | \n", "[{\"name\": \"Columbia Pictures\", \"id\": 5}, {\"nam... | \n", "[{\"iso_3166_1\": \"GB\", \"name\": \"United Kingdom\"... | \n", "2015-10-26 | \n", "880674609 | \n", "148.0 | \n", "[{\"iso_639_1\": \"fr\", \"name\": \"Fran\\u00e7ais\"},... | \n", "Released | \n", "A Plan No One Escapes | \n", "Spectre | \n", "6.3 | \n", "4466 | \n", "
3 | \n", "250000000 | \n", "[{\"id\": 28, \"name\": \"Action\"}, {\"id\": 80, \"nam... | \n", "http://www.thedarkknightrises.com/ | \n", "49026 | \n", "[{\"id\": 849, \"name\": \"dc comics\"}, {\"id\": 853,... | \n", "en | \n", "The Dark Knight Rises | \n", "Following the death of District Attorney Harve... | \n", "112.312950 | \n", "[{\"name\": \"Legendary Pictures\", \"id\": 923}, {\"... | \n", "[{\"iso_3166_1\": \"US\", \"name\": \"United States o... | \n", "2012-07-16 | \n", "1084939099 | \n", "165.0 | \n", "[{\"iso_639_1\": \"en\", \"name\": \"English\"}] | \n", "Released | \n", "The Legend Ends | \n", "The Dark Knight Rises | \n", "7.6 | \n", "9106 | \n", "
4 | \n", "260000000 | \n", "[{\"id\": 28, \"name\": \"Action\"}, {\"id\": 12, \"nam... | \n", "http://movies.disney.com/john-carter | \n", "49529 | \n", "[{\"id\": 818, \"name\": \"based on novel\"}, {\"id\":... | \n", "en | \n", "John Carter | \n", "John Carter is a war-weary, former military ca... | \n", "43.926995 | \n", "[{\"name\": \"Walt Disney Pictures\", \"id\": 2}] | \n", "[{\"iso_3166_1\": \"US\", \"name\": \"United States o... | \n", "2012-03-07 | \n", "284139100 | \n", "132.0 | \n", "[{\"iso_639_1\": \"en\", \"name\": \"English\"}] | \n", "Released | \n", "Lost in our world, found in another. | \n", "John Carter | \n", "6.1 | \n", "2124 | \n", "
\n", " | movie_id | \n", "title | \n", "overview | \n", "genres | \n", "keywords | \n", "cast | \n", "crew | \n", "
---|---|---|---|---|---|---|---|
0 | \n", "19995 | \n", "Avatar | \n", "In the 22nd century, a paraplegic Marine is di... | \n", "[{\"id\": 28, \"name\": \"Action\"}, {\"id\": 12, \"nam... | \n", "[{\"id\": 1463, \"name\": \"culture clash\"}, {\"id\":... | \n", "[{\"cast_id\": 242, \"character\": \"Jake Sully\", \"... | \n", "[{\"credit_id\": \"52fe48009251416c750aca23\", \"de... | \n", "
1 | \n", "285 | \n", "Pirates of the Caribbean: At World's End | \n", "Captain Barbossa, long believed to be dead, ha... | \n", "[{\"id\": 12, \"name\": \"Adventure\"}, {\"id\": 14, \"... | \n", "[{\"id\": 270, \"name\": \"ocean\"}, {\"id\": 726, \"na... | \n", "[{\"cast_id\": 4, \"character\": \"Captain Jack Spa... | \n", "[{\"credit_id\": \"52fe4232c3a36847f800b579\", \"de... | \n", "
2 | \n", "206647 | \n", "Spectre | \n", "A cryptic message from Bond’s past sends him o... | \n", "[{\"id\": 28, \"name\": \"Action\"}, {\"id\": 12, \"nam... | \n", "[{\"id\": 470, \"name\": \"spy\"}, {\"id\": 818, \"name... | \n", "[{\"cast_id\": 1, \"character\": \"James Bond\", \"cr... | \n", "[{\"credit_id\": \"54805967c3a36829b5002c41\", \"de... | \n", "
3 | \n", "49026 | \n", "The Dark Knight Rises | \n", "Following the death of District Attorney Harve... | \n", "[{\"id\": 28, \"name\": \"Action\"}, {\"id\": 80, \"nam... | \n", "[{\"id\": 849, \"name\": \"dc comics\"}, {\"id\": 853,... | \n", "[{\"cast_id\": 2, \"character\": \"Bruce Wayne / Ba... | \n", "[{\"credit_id\": \"52fe4781c3a36847f81398c3\", \"de... | \n", "
4 | \n", "49529 | \n", "John Carter | \n", "John Carter is a war-weary, former military ca... | \n", "[{\"id\": 28, \"name\": \"Action\"}, {\"id\": 12, \"nam... | \n", "[{\"id\": 818, \"name\": \"based on novel\"}, {\"id\":... | \n", "[{\"cast_id\": 5, \"character\": \"John Carter\", \"c... | \n", "[{\"credit_id\": \"52fe479ac3a36847f813eaa3\", \"de... | \n", "
\n", " | movie_id | \n", "title | \n", "overview | \n", "genres | \n", "keywords | \n", "cast | \n", "crew | \n", "
---|---|---|---|---|---|---|---|
0 | \n", "19995 | \n", "Avatar | \n", "In the 22nd century, a paraplegic Marine is di... | \n", "[Action, Adventure, Fantasy, Science Fiction] | \n", "[culture clash, future, space war, space colon... | \n", "[{\"cast_id\": 242, \"character\": \"Jake Sully\", \"... | \n", "[{\"credit_id\": \"52fe48009251416c750aca23\", \"de... | \n", "
1 | \n", "285 | \n", "Pirates of the Caribbean: At World's End | \n", "Captain Barbossa, long believed to be dead, ha... | \n", "[Adventure, Fantasy, Action] | \n", "[ocean, drug abuse, exotic island, east india ... | \n", "[{\"cast_id\": 4, \"character\": \"Captain Jack Spa... | \n", "[{\"credit_id\": \"52fe4232c3a36847f800b579\", \"de... | \n", "
2 | \n", "206647 | \n", "Spectre | \n", "A cryptic message from Bond’s past sends him o... | \n", "[Action, Adventure, Crime] | \n", "[spy, based on novel, secret agent, sequel, mi... | \n", "[{\"cast_id\": 1, \"character\": \"James Bond\", \"cr... | \n", "[{\"credit_id\": \"54805967c3a36829b5002c41\", \"de... | \n", "
3 | \n", "49026 | \n", "The Dark Knight Rises | \n", "Following the death of District Attorney Harve... | \n", "[Action, Crime, Drama, Thriller] | \n", "[dc comics, crime fighter, terrorist, secret i... | \n", "[{\"cast_id\": 2, \"character\": \"Bruce Wayne / Ba... | \n", "[{\"credit_id\": \"52fe4781c3a36847f81398c3\", \"de... | \n", "
4 | \n", "49529 | \n", "John Carter | \n", "John Carter is a war-weary, former military ca... | \n", "[Action, Adventure, Science Fiction] | \n", "[based on novel, mars, medallion, space travel... | \n", "[{\"cast_id\": 5, \"character\": \"John Carter\", \"c... | \n", "[{\"credit_id\": \"52fe479ac3a36847f813eaa3\", \"de... | \n", "
\n", " | movie_id | \n", "title | \n", "overview | \n", "genres | \n", "keywords | \n", "cast | \n", "crew | \n", "
---|---|---|---|---|---|---|---|
0 | \n", "19995 | \n", "Avatar | \n", "In the 22nd century, a paraplegic Marine is di... | \n", "[Action, Adventure, Fantasy, Science Fiction] | \n", "[culture clash, future, space war, space colon... | \n", "[Sam Worthington, Zoe Saldana, Sigourney Weave... | \n", "[{\"credit_id\": \"52fe48009251416c750aca23\", \"de... | \n", "
\n", " | movie_id | \n", "title | \n", "overview | \n", "genres | \n", "keywords | \n", "cast | \n", "crew | \n", "
---|---|---|---|---|---|---|---|
0 | \n", "19995 | \n", "Avatar | \n", "In the 22nd century, a paraplegic Marine is di... | \n", "[Action, Adventure, Fantasy, Science Fiction] | \n", "[culture clash, future, space war, space colon... | \n", "[Sam Worthington, Zoe Saldana, Sigourney Weave... | \n", "[James Cameron] | \n", "
1 | \n", "285 | \n", "Pirates of the Caribbean: At World's End | \n", "Captain Barbossa, long believed to be dead, ha... | \n", "[Adventure, Fantasy, Action] | \n", "[ocean, drug abuse, exotic island, east india ... | \n", "[Johnny Depp, Orlando Bloom, Keira Knightley, ... | \n", "[Gore Verbinski] | \n", "
2 | \n", "206647 | \n", "Spectre | \n", "A cryptic message from Bond’s past sends him o... | \n", "[Action, Adventure, Crime] | \n", "[spy, based on novel, secret agent, sequel, mi... | \n", "[Daniel Craig, Christoph Waltz, Léa Seydoux, R... | \n", "[Sam Mendes] | \n", "
3 | \n", "49026 | \n", "The Dark Knight Rises | \n", "Following the death of District Attorney Harve... | \n", "[Action, Crime, Drama, Thriller] | \n", "[dc comics, crime fighter, terrorist, secret i... | \n", "[Christian Bale, Michael Caine, Gary Oldman, A... | \n", "[Christopher Nolan] | \n", "
4 | \n", "49529 | \n", "John Carter | \n", "John Carter is a war-weary, former military ca... | \n", "[Action, Adventure, Science Fiction] | \n", "[based on novel, mars, medallion, space travel... | \n", "[Taylor Kitsch, Lynn Collins, Samantha Morton,... | \n", "[Andrew Stanton] | \n", "
5 | \n", "559 | \n", "Spider-Man 3 | \n", "The seemingly invincible Spider-Man goes up ag... | \n", "[Fantasy, Action, Adventure] | \n", "[dual identity, amnesia, sandstorm, love of on... | \n", "[Tobey Maguire, Kirsten Dunst, James Franco, T... | \n", "[Sam Raimi] | \n", "
6 | \n", "38757 | \n", "Tangled | \n", "When the kingdom's most wanted-and most charmi... | \n", "[Animation, Family] | \n", "[hostage, magic, horse, fairy tale, musical, p... | \n", "[Zachary Levi, Mandy Moore, Donna Murphy, Ron ... | \n", "[Byron Howard] | \n", "
7 | \n", "99861 | \n", "Avengers: Age of Ultron | \n", "When Tony Stark tries to jumpstart a dormant p... | \n", "[Action, Adventure, Science Fiction] | \n", "[marvel comic, sequel, superhero, based on com... | \n", "[Robert Downey Jr., Chris Hemsworth, Mark Ruff... | \n", "[Joss Whedon] | \n", "
8 | \n", "767 | \n", "Harry Potter and the Half-Blood Prince | \n", "As Harry begins his sixth year at Hogwarts, he... | \n", "[Adventure, Fantasy, Family] | \n", "[witch, magic, broom, school of witchcraft, wi... | \n", "[Daniel Radcliffe, Rupert Grint, Emma Watson, ... | \n", "[David Yates] | \n", "
9 | \n", "209112 | \n", "Batman v Superman: Dawn of Justice | \n", "Fearing the actions of a god-like Super Hero l... | \n", "[Action, Adventure, Fantasy] | \n", "[dc comics, vigilante, superhero, based on com... | \n", "[Ben Affleck, Henry Cavill, Gal Gadot, Amy Adams] | \n", "[Zack Snyder] | \n", "
\n", " | movie_id | \n", "title | \n", "overview | \n", "genres | \n", "keywords | \n", "cast | \n", "crew | \n", "
---|---|---|---|---|---|---|---|
0 | \n", "19995 | \n", "Avatar | \n", "[In, the, 22nd, century,, a, paraplegic, Marin... | \n", "[Action, Adventure, Fantasy, Science Fiction] | \n", "[culture clash, future, space war, space colon... | \n", "[Sam Worthington, Zoe Saldana, Sigourney Weave... | \n", "[James Cameron] | \n", "
1 | \n", "285 | \n", "Pirates of the Caribbean: At World's End | \n", "[Captain, Barbossa,, long, believed, to, be, d... | \n", "[Adventure, Fantasy, Action] | \n", "[ocean, drug abuse, exotic island, east india ... | \n", "[Johnny Depp, Orlando Bloom, Keira Knightley, ... | \n", "[Gore Verbinski] | \n", "
2 | \n", "206647 | \n", "Spectre | \n", "[A, cryptic, message, from, Bond’s, past, send... | \n", "[Action, Adventure, Crime] | \n", "[spy, based on novel, secret agent, sequel, mi... | \n", "[Daniel Craig, Christoph Waltz, Léa Seydoux, R... | \n", "[Sam Mendes] | \n", "
3 | \n", "49026 | \n", "The Dark Knight Rises | \n", "[Following, the, death, of, District, Attorney... | \n", "[Action, Crime, Drama, Thriller] | \n", "[dc comics, crime fighter, terrorist, secret i... | \n", "[Christian Bale, Michael Caine, Gary Oldman, A... | \n", "[Christopher Nolan] | \n", "
4 | \n", "49529 | \n", "John Carter | \n", "[John, Carter, is, a, war-weary,, former, mili... | \n", "[Action, Adventure, Science Fiction] | \n", "[based on novel, mars, medallion, space travel... | \n", "[Taylor Kitsch, Lynn Collins, Samantha Morton,... | \n", "[Andrew Stanton] | \n", "
\n", " | movie_id | \n", "title | \n", "overview | \n", "genres | \n", "keywords | \n", "cast | \n", "crew | \n", "
---|---|---|---|---|---|---|---|
0 | \n", "19995 | \n", "Avatar | \n", "[In, the, 22nd, century,, a, paraplegic, Marin... | \n", "[Action, Adventure, Fantasy, ScienceFiction] | \n", "[cultureclash, future, spacewar, spacecolony, ... | \n", "[SamWorthington, ZoeSaldana, SigourneyWeaver, ... | \n", "[JamesCameron] | \n", "
1 | \n", "285 | \n", "Pirates of the Caribbean: At World's End | \n", "[Captain, Barbossa,, long, believed, to, be, d... | \n", "[Adventure, Fantasy, Action] | \n", "[ocean, drugabuse, exoticisland, eastindiatrad... | \n", "[JohnnyDepp, OrlandoBloom, KeiraKnightley, Ste... | \n", "[GoreVerbinski] | \n", "
2 | \n", "206647 | \n", "Spectre | \n", "[A, cryptic, message, from, Bond’s, past, send... | \n", "[Action, Adventure, Crime] | \n", "[spy, basedonnovel, secretagent, sequel, mi6, ... | \n", "[DanielCraig, ChristophWaltz, LéaSeydoux, Ralp... | \n", "[SamMendes] | \n", "
3 | \n", "49026 | \n", "The Dark Knight Rises | \n", "[Following, the, death, of, District, Attorney... | \n", "[Action, Crime, Drama, Thriller] | \n", "[dccomics, crimefighter, terrorist, secretiden... | \n", "[ChristianBale, MichaelCaine, GaryOldman, Anne... | \n", "[ChristopherNolan] | \n", "
4 | \n", "49529 | \n", "John Carter | \n", "[John, Carter, is, a, war-weary,, former, mili... | \n", "[Action, Adventure, ScienceFiction] | \n", "[basedonnovel, mars, medallion, spacetravel, p... | \n", "[TaylorKitsch, LynnCollins, SamanthaMorton, Wi... | \n", "[AndrewStanton] | \n", "
\n", " | movie_id | \n", "title | \n", "tags | \n", "
---|---|---|---|
0 | \n", "19995 | \n", "Avatar | \n", "in the 22nd century, a paraplegic marine is di... | \n", "
1 | \n", "285 | \n", "Pirates of the Caribbean: At World's End | \n", "captain barbossa, long believed to be dead, ha... | \n", "
2 | \n", "206647 | \n", "Spectre | \n", "a cryptic message from bond’s past sends him o... | \n", "
3 | \n", "49026 | \n", "The Dark Knight Rises | \n", "following the death of district attorney harve... | \n", "
4 | \n", "49529 | \n", "John Carter | \n", "john carter is a war-weary, former military ca... | \n", "