{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "#! pip install -r ../requirements.txt" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "import pandas as pd" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "movies_path = '../data/standard/movies_m10_rich'" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "links = pd.read_csv('../data/standard/links.csv', index_col='movieId') # ids do filme y nas plataformas imdb e tmdb, util para enriquecer os dados\n", "movies = pd.read_csv(movies_path+'.csv', index_col='movieId') # dados do filme y\n", "ratings = pd.read_csv('../data/reduced/ratings_m10.csv', index_col='movieId') # avaliacao do usuario x pro filme y\n", "tags = pd.read_csv('../data/standard/tags.csv', index_col='movieId') # n parece mto relevante" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## separação do ano de lançamento" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "movies[['title', 'year']] = movies['title'].str.extract('(.+)+\\((\\d+)', expand=True)\n", "\n", "movies.head()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | tmdbId | \n", "imdbId | \n", "cast | \n", "director | \n", "keywords | \n", "overview | \n", "title | \n", "genres | \n", "year | \n", "
---|---|---|---|---|---|---|---|---|---|
movieId | \n", "\n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " |
117529 | \n", "135397 | \n", "369610 | \n", "Chris Pratt|Bryce Dallas Howard|Irrfan Khan|Vi... | \n", "Colin Trevorrow | \n", "monster|dna|tyrannosaurus rex|velociraptor|island | \n", "Twenty-two years after the events of Jurassic ... | \n", "Jurassic World | \n", "Action|Adventure|Drama|Sci-Fi|Thriller | \n", "2015 | \n", "
122882 | \n", "76341 | \n", "1392190 | \n", "Tom Hardy|Charlize Theron|Hugh Keays-Byrne|Nic... | \n", "George Miller | \n", "future|chase|post-apocalyptic|dystopia|australia | \n", "An apocalyptic story set in the furthest reach... | \n", "Mad Max: Fury Road | \n", "Action|Adventure|Sci-Fi|Thriller | \n", "2015 | \n", "
122886 | \n", "140607 | \n", "2488496 | \n", "Harrison Ford|Mark Hamill|Carrie Fisher|Adam D... | \n", "J.J. Abrams | \n", "android|spaceship|jedi|space opera|3d | \n", "Thirty years after defeating the Galactic Empi... | \n", "Star Wars: Episode VII - The Force Awakens | \n", "Action|Adventure|Fantasy|Sci-Fi|IMAX | \n", "2015 | \n", "
139385 | \n", "281957 | \n", "1663202 | \n", "Leonardo DiCaprio|Tom Hardy|Will Poulter|Domhn... | \n", "Alejandro González Iñárritu | \n", "father-son relationship|rape|based on novel|mo... | \n", "In the 1820s, a frontiersman, Hugh Glass, sets... | \n", "The Revenant | \n", "Adventure|Drama | \n", "2015 | \n", "
134130 | \n", "286217 | \n", "3659388 | \n", "Matt Damon|Jessica Chastain|Kristen Wiig|Jeff ... | \n", "Ridley Scott | \n", "based on novel|mars|nasa|isolation|botanist | \n", "During a manned mission to Mars, Astronaut Mar... | \n", "The Martian | \n", "Adventure|Drama|Sci-Fi | \n", "2015 | \n", "
\n", " | tmdbId | \n", "imdbId | \n", "cast | \n", "director | \n", "keywords | \n", "overview | \n", "title | \n", "genres | \n", "year | \n", "
---|---|---|---|---|---|---|---|---|---|
movieId | \n", "\n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " |
117529 | \n", "135397 | \n", "369610 | \n", "[Chris Pratt, Bryce Dallas Howard, Irrfan Khan... | \n", "Colin Trevorrow | \n", "[monster, dna, tyrannosaurus rex, velociraptor... | \n", "Twenty-two years after the events of Jurassic ... | \n", "Jurassic World | \n", "[Action, Adventure, Drama, Sci-Fi, Thriller] | \n", "2015 | \n", "
122882 | \n", "76341 | \n", "1392190 | \n", "[Tom Hardy, Charlize Theron, Hugh Keays-Byrne,... | \n", "George Miller | \n", "[future, chase, post-apocalyptic, dystopia, au... | \n", "An apocalyptic story set in the furthest reach... | \n", "Mad Max: Fury Road | \n", "[Action, Adventure, Sci-Fi, Thriller] | \n", "2015 | \n", "
122886 | \n", "140607 | \n", "2488496 | \n", "[Harrison Ford, Mark Hamill, Carrie Fisher, Ad... | \n", "J.J. Abrams | \n", "[android, spaceship, jedi, space opera, 3d] | \n", "Thirty years after defeating the Galactic Empi... | \n", "Star Wars: Episode VII - The Force Awakens | \n", "[Action, Adventure, Fantasy, Sci-Fi, IMAX] | \n", "2015 | \n", "
139385 | \n", "281957 | \n", "1663202 | \n", "[Leonardo DiCaprio, Tom Hardy, Will Poulter, D... | \n", "Alejandro González Iñárritu | \n", "[father-son relationship, rape, based on novel... | \n", "In the 1820s, a frontiersman, Hugh Glass, sets... | \n", "The Revenant | \n", "[Adventure, Drama] | \n", "2015 | \n", "
134130 | \n", "286217 | \n", "3659388 | \n", "[Matt Damon, Jessica Chastain, Kristen Wiig, J... | \n", "Ridley Scott | \n", "[based on novel, mars, nasa, isolation, botanist] | \n", "During a manned mission to Mars, Astronaut Mar... | \n", "The Martian | \n", "[Adventure, Drama, Sci-Fi] | \n", "2015 | \n", "
\n", " | tmdbId | \n", "imdbId | \n", "cast | \n", "director | \n", "keywords | \n", "overview | \n", "title | \n", "genres | \n", "year | \n", "movieId | \n", "
---|---|---|---|---|---|---|---|---|---|---|
1 | \n", "862 | \n", "114709 | \n", "[Tom Hanks, Tim Allen, Don Rickles, Jim Varney... | \n", "John Lasseter | \n", "[jealousy, toy, boy, friendship, friends] | \n", "Woody the cowboy is young Andy’s favorite to... | \n", "Toy Story | \n", "[Adventure, Animation, Children, Comedy, Fantasy] | \n", "1995 | \n", "1 | \n", "
2 | \n", "8844 | \n", "113497 | \n", "[Robin Williams, Jonathan Hyde, Kirsten Dunst,... | \n", "Joe Johnston | \n", "[board game, disappearance, based on a childre... | \n", "When siblings Judy and Peter discover an encha... | \n", "Jumanji | \n", "[Adventure, Children, Fantasy] | \n", "1995 | \n", "2 | \n", "
3 | \n", "15602 | \n", "113228 | \n", "[Walter Matthau, Jack Lemmon, Ann-Margret, Sop... | \n", "Howard Deutch | \n", "[fishing, best friend, duringcreditsstinger, o... | \n", "A family wedding reignites the ancient feud be... | \n", "Grumpier Old Men | \n", "[Comedy, Romance] | \n", "1995 | \n", "3 | \n", "
4 | \n", "11862 | \n", "113041 | \n", "[Steve Martin, Diane Keaton, Martin Short, Kim... | \n", "Charles Shyer | \n", "[baby, midlife crisis, confidence, aging, daug... | \n", "Just when George Banks has recovered from his ... | \n", "Father of the Bride Part II | \n", "[Comedy] | \n", "1995 | \n", "4 | \n", "
5 | \n", "949 | \n", "113277 | \n", "[Al Pacino, Robert De Niro, Val Kilmer, Jon Vo... | \n", "Michael Mann | \n", "[gambling, suicide attempt, burglar, booties, ... | \n", "Obsessive master thief, Neil McCauley leads a ... | \n", "Heat | \n", "[Action, Crime, Thriller] | \n", "1995 | \n", "5 | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
2022 | \n", "281957 | \n", "1663202 | \n", "[Leonardo DiCaprio, Tom Hardy, Will Poulter, D... | \n", "Alejandro González Iñárritu | \n", "[father-son relationship, rape, based on novel... | \n", "In the 1820s, a frontiersman, Hugh Glass, sets... | \n", "The Revenant | \n", "[Adventure, Drama] | \n", "2015 | \n", "2022 | \n", "
2023 | \n", "273481 | \n", "3397884 | \n", "[Emily Blunt, Benicio del Toro, Josh Brolin, V... | \n", "Denis Villeneuve | \n", "[mexico, cia, smoking, texas, fbi] | \n", "A young female FBI agent joins a secret CIA op... | \n", "Sicario | \n", "[Crime, Drama, Mystery] | \n", "2015 | \n", "2023 | \n", "
2024 | \n", "257211 | \n", "2361509 | \n", "[Robert De Niro, Anne Hathaway, Rene Russo, An... | \n", "Nancy Meyers | \n", "[intern, woman director] | \n", "70-year-old widower Ben Whittaker has discover... | \n", "The Intern | \n", "[Comedy] | \n", "2015 | \n", "2024 | \n", "
2025 | \n", "314365 | \n", "1895587 | \n", "[Mark Ruffalo, Michael Keaton, Rachel McAdams,... | \n", "Tom McCarthy | \n", "[child abuse, journalism, judge, florida, boston] | \n", "The true story of how The Boston Globe uncover... | \n", "Spotlight | \n", "[Thriller] | \n", "2015 | \n", "2025 | \n", "
2026 | \n", "318846 | \n", "1596363 | \n", "[Christian Bale, Steve Carell, Ryan Gosling, B... | \n", "Adam McKay | \n", "[bank, fraud, biography, wall street, finances] | \n", "The men who made millions from a global econom... | \n", "Big Short, The | \n", "[Drama] | \n", "2015 | \n", "2026 | \n", "
2026 rows × 10 columns
\n", "