Applying multiple filter criter to a pandas DataFrame
This introduction to pandas is derived from Data School's pandas Q&A with my own notes and code.
Applying multiple filter criter to a pandas DataFrame¶
In [1]:
import pandas as pd
In [2]:
url = 'http://bit.ly/imdbratings'
# Create movies DataFrame
movies = pd.read_csv(url)
In [3]:
movies.head()
Out[3]:
star_rating | title | content_rating | genre | duration | actors_list | |
---|---|---|---|---|---|---|
0 | 9.3 | The Shawshank Redemption | R | Crime | 142 | [u'Tim Robbins', u'Morgan Freeman', u'Bob Gunt... |
1 | 9.2 | The Godfather | R | Crime | 175 | [u'Marlon Brando', u'Al Pacino', u'James Caan'] |
2 | 9.1 | The Godfather: Part II | R | Crime | 200 | [u'Al Pacino', u'Robert De Niro', u'Robert Duv... |
3 | 9.0 | The Dark Knight | PG-13 | Action | 152 | [u'Christian Bale', u'Heath Ledger', u'Aaron E... |
4 | 8.9 | Pulp Fiction | R | Crime | 154 | [u'John Travolta', u'Uma Thurman', u'Samuel L.... |
In [8]:
movies[movies.duration >= 200]
Out[8]:
star_rating | title | content_rating | genre | duration | actors_list | |
---|---|---|---|---|---|---|
2 | 9.1 | The Godfather: Part II | R | Crime | 200 | [u'Al Pacino', u'Robert De Niro', u'Robert Duv... |
7 | 8.9 | The Lord of the Rings: The Return of the King | PG-13 | Adventure | 201 | [u'Elijah Wood', u'Viggo Mortensen', u'Ian McK... |
17 | 8.7 | Seven Samurai | UNRATED | Drama | 207 | [u'Toshir\xf4 Mifune', u'Takashi Shimura', u'K... |
78 | 8.4 | Once Upon a Time in America | R | Crime | 229 | [u'Robert De Niro', u'James Woods', u'Elizabet... |
85 | 8.4 | Lawrence of Arabia | PG | Adventure | 216 | [u"Peter O'Toole", u'Alec Guinness', u'Anthony... |
142 | 8.3 | Lagaan: Once Upon a Time in India | PG | Adventure | 224 | [u'Aamir Khan', u'Gracy Singh', u'Rachel Shell... |
157 | 8.2 | Gone with the Wind | G | Drama | 238 | [u'Clark Gable', u'Vivien Leigh', u'Thomas Mit... |
204 | 8.1 | Ben-Hur | G | Adventure | 212 | [u'Charlton Heston', u'Jack Hawkins', u'Stephe... |
445 | 7.9 | The Ten Commandments | APPROVED | Adventure | 220 | [u'Charlton Heston', u'Yul Brynner', u'Anne Ba... |
476 | 7.8 | Hamlet | PG-13 | Drama | 242 | [u'Kenneth Branagh', u'Julie Christie', u'Dere... |
630 | 7.7 | Malcolm X | PG-13 | Biography | 202 | [u'Denzel Washington', u'Angela Bassett', u'De... |
767 | 7.6 | It's a Mad, Mad, Mad, Mad World | APPROVED | Action | 205 | [u'Spencer Tracy', u'Milton Berle', u'Ethel Me... |
2 conditions
- duration > 200
- genre only Drama
In [13]:
True or False
Out[13]:
True
In [10]:
True or True
Out[10]:
True
In [11]:
False or False
Out[11]:
False
In [14]:
True and True
Out[14]:
True
In [16]:
True and False
Out[16]:
False
In [18]:
# when you wrap conditions in parantheses, you give order
# you do those in brackets first before 'and'
# AND
movies[(movies.duration >= 200) & (movies.genre == 'Drama')]
Out[18]:
star_rating | title | content_rating | genre | duration | actors_list | |
---|---|---|---|---|---|---|
17 | 8.7 | Seven Samurai | UNRATED | Drama | 207 | [u'Toshir\xf4 Mifune', u'Takashi Shimura', u'K... |
157 | 8.2 | Gone with the Wind | G | Drama | 238 | [u'Clark Gable', u'Vivien Leigh', u'Thomas Mit... |
476 | 7.8 | Hamlet | PG-13 | Drama | 242 | [u'Kenneth Branagh', u'Julie Christie', u'Dere... |
In [20]:
# OR
movies[(movies.duration >= 200) | (movies.genre == 'Drama')]
Out[20]:
star_rating | title | content_rating | genre | duration | actors_list | |
---|---|---|---|---|---|---|
2 | 9.1 | The Godfather: Part II | R | Crime | 200 | [u'Al Pacino', u'Robert De Niro', u'Robert Duv... |
5 | 8.9 | 12 Angry Men | NOT RATED | Drama | 96 | [u'Henry Fonda', u'Lee J. Cobb', u'Martin Bals... |
7 | 8.9 | The Lord of the Rings: The Return of the King | PG-13 | Adventure | 201 | [u'Elijah Wood', u'Viggo Mortensen', u'Ian McK... |
9 | 8.9 | Fight Club | R | Drama | 139 | [u'Brad Pitt', u'Edward Norton', u'Helena Bonh... |
13 | 8.8 | Forrest Gump | PG-13 | Drama | 142 | [u'Tom Hanks', u'Robin Wright', u'Gary Sinise'] |
16 | 8.7 | One Flew Over the Cuckoo's Nest | R | Drama | 133 | [u'Jack Nicholson', u'Louise Fletcher', u'Mich... |
17 | 8.7 | Seven Samurai | UNRATED | Drama | 207 | [u'Toshir\xf4 Mifune', u'Takashi Shimura', u'K... |
22 | 8.7 | It's a Wonderful Life | APPROVED | Drama | 130 | [u'James Stewart', u'Donna Reed', u'Lionel Bar... |
24 | 8.7 | Se7en | R | Drama | 127 | [u'Morgan Freeman', u'Brad Pitt', u'Kevin Spac... |
27 | 8.6 | The Silence of the Lambs | R | Drama | 118 | [u'Jodie Foster', u'Anthony Hopkins', u'Lawren... |
32 | 8.6 | Casablanca | PG | Drama | 102 | [u'Humphrey Bogart', u'Ingrid Bergman', u'Paul... |
33 | 8.6 | Whiplash | R | Drama | 107 | [u'Miles Teller', u'J.K. Simmons', u'Melissa B... |
41 | 8.5 | Sunset Blvd. | NOT RATED | Drama | 110 | [u'William Holden', u'Gloria Swanson', u'Erich... |
47 | 8.5 | Taare Zameen Par | PG | Drama | 165 | [u'Darsheel Safary', u'Aamir Khan', u'Tanay Ch... |
50 | 8.5 | Cinema Paradiso | R | Drama | 155 | [u'Philippe Noiret', u'Enzo Cannavale', u'Anto... |
51 | 8.5 | Apocalypse Now | R | Drama | 153 | [u'Martin Sheen', u'Marlon Brando', u'Robert D... |
53 | 8.5 | The Prestige | PG-13 | Drama | 130 | [u'Christian Bale', u'Hugh Jackman', u'Scarlet... |
56 | 8.5 | The Lives of Others | R | Drama | 137 | [u'Ulrich M\xfche', u'Martina Gedeck', u'Sebas... |
58 | 8.5 | Paths of Glory | APPROVED | Drama | 88 | [u'Kirk Douglas', u'Ralph Meeker', u'Adolphe M... |
67 | 8.4 | American Beauty | R | Drama | 122 | [u'Kevin Spacey', u'Annette Bening', u'Thora B... |
72 | 8.4 | Rang De Basanti | NOT RATED | Drama | 157 | [u'Aamir Khan', u'Soha Ali Khan', u'Siddharth'] |
73 | 8.4 | Jodaeiye Nader az Simin | PG-13 | Drama | 123 | [u'Peyman Moaadi', u'Leila Hatami', u'Sareh Ba... |
74 | 8.4 | Citizen Kane | APPROVED | Drama | 119 | [u'Orson Welles', u'Joseph Cotten', u'Dorothy ... |
77 | 8.4 | Oldeuboi | R | Drama | 120 | [u'Min-sik Choi', u'Ji-tae Yu', u'Hye-jeong Ka... |
78 | 8.4 | Once Upon a Time in America | R | Crime | 229 | [u'Robert De Niro', u'James Woods', u'Elizabet... |
83 | 8.4 | To Kill a Mockingbird | NOT RATED | Drama | 129 | [u'Gregory Peck', u'John Megna', u'Frank Overt... |
84 | 8.4 | Requiem for a Dream | R | Drama | 102 | [u'Ellen Burstyn', u'Jared Leto', u'Jennifer C... |
85 | 8.4 | Lawrence of Arabia | PG | Adventure | 216 | [u"Peter O'Toole", u'Alec Guinness', u'Anthony... |
87 | 8.4 | Bicycle Thieves | NOT RATED | Drama | 93 | [u'Lamberto Maggiorani', u'Enzo Staiola', u'Li... |
89 | 8.4 | Swades | NOT RATED | Drama | 189 | [u'Shah Rukh Khan', u'Gayatri Joshi', u'Kishor... |
... | ... | ... | ... | ... | ... | ... |
875 | 7.5 | Rust and Bone | R | Drama | 120 | [u'Marion Cotillard', u'Matthias Schoenaerts',... |
877 | 7.5 | Legends of the Fall | R | Drama | 133 | [u'Brad Pitt', u'Anthony Hopkins', u'Aidan Qui... |
879 | 7.5 | The Constant Gardener | R | Drama | 129 | [u'Ralph Fiennes', u'Rachel Weisz', u'Hubert K... |
886 | 7.5 | Pi | R | Drama | 84 | [u'Sean Gullette', u'Mark Margolis', u'Ben She... |
887 | 7.5 | The Devil's Backbone | R | Drama | 106 | [u'Marisa Paredes', u'Eduardo Noriega', u'Fede... |
889 | 7.5 | Devil's Advocate | R | Drama | 144 | [u'Keanu Reeves', u'Al Pacino', u'Charlize The... |
895 | 7.5 | Biutiful | R | Drama | 148 | [u'Javier Bardem', u'Maricel \xc1lvarez', u'Ha... |
897 | 7.5 | Calvary | R | Drama | 102 | [u'Brendan Gleeson', u"Chris O'Dowd", u'Kelly ... |
901 | 7.5 | Babel | R | Drama | 143 | [u'Brad Pitt', u'Cate Blanchett', u'Gael Garc\... |
904 | 7.5 | Sweeney Todd: The Demon Barber of Fleet Street | R | Drama | 116 | [u'Johnny Depp', u'Helena Bonham Carter', u'Al... |
910 | 7.5 | 2046 | R | Drama | 129 | [u'Tony Chiu Wai Leung', u'Ziyi Zhang', u'Faye... |
914 | 7.5 | The Judge | R | Drama | 141 | [u'Robert Downey Jr.', u'Robert Duvall', u'Ver... |
916 | 7.5 | Up in the Air | R | Drama | 109 | [u'George Clooney', u'Vera Farmiga', u'Anna Ke... |
917 | 7.5 | Begin Again | R | Drama | 104 | [u'Keira Knightley', u'Mark Ruffalo', u'Adam L... |
922 | 7.5 | Mud | PG-13 | Drama | 130 | [u'Matthew McConaughey', u'Tye Sheridan', u'Ja... |
923 | 7.5 | Across the Universe | PG-13 | Drama | 133 | [u'Evan Rachel Wood', u'Jim Sturgess', u'Joe A... |
925 | 7.5 | Notes on a Scandal | R | Drama | 92 | [u'Cate Blanchett', u'Judi Dench', u'Andrew Si... |
926 | 7.5 | Inside Llewyn Davis | R | Drama | 104 | [u'Oscar Isaac', u'Carey Mulligan', u'John Goo... |
939 | 7.4 | Predestination | R | Drama | 97 | [u'Ethan Hawke', u'Sarah Snook', u'Noah Taylor'] |
941 | 7.4 | A Bridge Too Far | PG | Drama | 175 | [u'Sean Connery', u"Ryan O'Neal", u'Michael Ca... |
945 | 7.4 | Take Shelter | R | Drama | 120 | [u'Michael Shannon', u'Jessica Chastain', u'Sh... |
946 | 7.4 | Far from Heaven | PG-13 | Drama | 107 | [u'Julianne Moore', u'Dennis Quaid', u'Dennis ... |
947 | 7.4 | Eraserhead | UNRATED | Drama | 89 | [u'Jack Nance', u'Charlotte Stewart', u'Allen ... |
951 | 7.4 | Sleepy Hollow | R | Drama | 105 | [u'Johnny Depp', u'Christina Ricci', u'Miranda... |
955 | 7.4 | Zero Dark Thirty | R | Drama | 157 | [u'Jessica Chastain', u'Joel Edgerton', u'Chri... |
958 | 7.4 | My Sister's Keeper | PG-13 | Drama | 109 | [u'Cameron Diaz', u'Abigail Breslin', u'Alec B... |
968 | 7.4 | The English Patient | R | Drama | 162 | [u'Ralph Fiennes', u'Juliette Binoche', u'Will... |
970 | 7.4 | Wonder Boys | R | Drama | 107 | [u'Michael Douglas', u'Tobey Maguire', u'Franc... |
972 | 7.4 | Blue Valentine | NC-17 | Drama | 112 | [u'Ryan Gosling', u'Michelle Williams', u'John... |
973 | 7.4 | The Cider House Rules | PG-13 | Drama | 126 | [u'Tobey Maguire', u'Charlize Theron', u'Micha... |
287 rows × 6 columns
In [21]:
(movies.duration >= 200) | (movies.genre == 'Drama')
Out[21]:
0 False 1 False 2 True 3 False 4 False 5 True 6 False 7 True 8 False 9 True 10 False 11 False 12 False 13 True 14 False 15 False 16 True 17 True 18 False 19 False 20 False 21 False 22 True 23 False 24 True 25 False 26 False 27 True 28 False 29 False ... 949 False 950 False 951 True 952 False 953 False 954 False 955 True 956 False 957 False 958 True 959 False 960 False 961 False 962 False 963 False 964 False 965 False 966 False 967 False 968 True 969 False 970 True 971 False 972 True 973 True 974 False 975 False 976 False 977 False 978 False dtype: bool
In [22]:
(movies.duration >= 200) & (movies.genre == 'Drama')
Out[22]:
0 False 1 False 2 False 3 False 4 False 5 False 6 False 7 False 8 False 9 False 10 False 11 False 12 False 13 False 14 False 15 False 16 False 17 True 18 False 19 False 20 False 21 False 22 False 23 False 24 False 25 False 26 False 27 False 28 False 29 False ... 949 False 950 False 951 False 952 False 953 False 954 False 955 False 956 False 957 False 958 False 959 False 960 False 961 False 962 False 963 False 964 False 965 False 966 False 967 False 968 False 969 False 970 False 971 False 972 False 973 False 974 False 975 False 976 False 977 False 978 False dtype: bool
What if you want genres crime, drama, and action?
In [23]:
# slow method
movies[(movies.genre == 'Crime') | (movies.genre == 'Drama') | (movies.genre == 'Action')]
Out[23]:
star_rating | title | content_rating | genre | duration | actors_list | |
---|---|---|---|---|---|---|
0 | 9.3 | The Shawshank Redemption | R | Crime | 142 | [u'Tim Robbins', u'Morgan Freeman', u'Bob Gunt... |
1 | 9.2 | The Godfather | R | Crime | 175 | [u'Marlon Brando', u'Al Pacino', u'James Caan'] |
2 | 9.1 | The Godfather: Part II | R | Crime | 200 | [u'Al Pacino', u'Robert De Niro', u'Robert Duv... |
3 | 9.0 | The Dark Knight | PG-13 | Action | 152 | [u'Christian Bale', u'Heath Ledger', u'Aaron E... |
4 | 8.9 | Pulp Fiction | R | Crime | 154 | [u'John Travolta', u'Uma Thurman', u'Samuel L.... |
5 | 8.9 | 12 Angry Men | NOT RATED | Drama | 96 | [u'Henry Fonda', u'Lee J. Cobb', u'Martin Bals... |
9 | 8.9 | Fight Club | R | Drama | 139 | [u'Brad Pitt', u'Edward Norton', u'Helena Bonh... |
11 | 8.8 | Inception | PG-13 | Action | 148 | [u'Leonardo DiCaprio', u'Joseph Gordon-Levitt'... |
12 | 8.8 | Star Wars: Episode V - The Empire Strikes Back | PG | Action | 124 | [u'Mark Hamill', u'Harrison Ford', u'Carrie Fi... |
13 | 8.8 | Forrest Gump | PG-13 | Drama | 142 | [u'Tom Hanks', u'Robin Wright', u'Gary Sinise'] |
16 | 8.7 | One Flew Over the Cuckoo's Nest | R | Drama | 133 | [u'Jack Nicholson', u'Louise Fletcher', u'Mich... |
17 | 8.7 | Seven Samurai | UNRATED | Drama | 207 | [u'Toshir\xf4 Mifune', u'Takashi Shimura', u'K... |
19 | 8.7 | Star Wars | PG | Action | 121 | [u'Mark Hamill', u'Harrison Ford', u'Carrie Fi... |
20 | 8.7 | The Matrix | R | Action | 136 | [u'Keanu Reeves', u'Laurence Fishburne', u'Car... |
21 | 8.7 | City of God | R | Crime | 130 | [u'Alexandre Rodrigues', u'Matheus Nachtergael... |
22 | 8.7 | It's a Wonderful Life | APPROVED | Drama | 130 | [u'James Stewart', u'Donna Reed', u'Lionel Bar... |
23 | 8.7 | The Usual Suspects | R | Crime | 106 | [u'Kevin Spacey', u'Gabriel Byrne', u'Chazz Pa... |
24 | 8.7 | Se7en | R | Drama | 127 | [u'Morgan Freeman', u'Brad Pitt', u'Kevin Spac... |
27 | 8.6 | The Silence of the Lambs | R | Drama | 118 | [u'Jodie Foster', u'Anthony Hopkins', u'Lawren... |
28 | 8.6 | Leon: The Professional | R | Crime | 110 | [u'Jean Reno', u'Gary Oldman', u'Natalie Portm... |
32 | 8.6 | Casablanca | PG | Drama | 102 | [u'Humphrey Bogart', u'Ingrid Bergman', u'Paul... |
33 | 8.6 | Whiplash | R | Drama | 107 | [u'Miles Teller', u'J.K. Simmons', u'Melissa B... |
34 | 8.6 | American History X | R | Crime | 119 | [u'Edward Norton', u'Edward Furlong', u"Beverl... |
36 | 8.6 | Saving Private Ryan | R | Action | 169 | [u'Tom Hanks', u'Matt Damon', u'Tom Sizemore'] |
37 | 8.6 | Raiders of the Lost Ark | PG | Action | 115 | [u'Harrison Ford', u'Karen Allen', u'Paul Free... |
40 | 8.5 | The Green Mile | R | Crime | 189 | [u'Tom Hanks', u'Michael Clarke Duncan', u'Dav... |
41 | 8.5 | Sunset Blvd. | NOT RATED | Drama | 110 | [u'William Holden', u'Gloria Swanson', u'Erich... |
43 | 8.5 | The Dark Knight Rises | PG-13 | Action | 165 | [u'Christian Bale', u'Tom Hardy', u'Anne Hatha... |
44 | 8.5 | Gladiator | R | Action | 155 | [u'Russell Crowe', u'Joaquin Phoenix', u'Conni... |
45 | 8.5 | Terminator 2: Judgment Day | R | Action | 137 | [u'Arnold Schwarzenegger', u'Linda Hamilton', ... |
... | ... | ... | ... | ... | ... | ... |
916 | 7.5 | Up in the Air | R | Drama | 109 | [u'George Clooney', u'Vera Farmiga', u'Anna Ke... |
917 | 7.5 | Begin Again | R | Drama | 104 | [u'Keira Knightley', u'Mark Ruffalo', u'Adam L... |
918 | 7.5 | Running Scared | R | Action | 122 | [u'Paul Walker', u'Cameron Bright', u'Chazz Pa... |
920 | 7.5 | Witness | R | Crime | 112 | [u'Harrison Ford', u'Kelly McGillis', u'Lukas ... |
922 | 7.5 | Mud | PG-13 | Drama | 130 | [u'Matthew McConaughey', u'Tye Sheridan', u'Ja... |
923 | 7.5 | Across the Universe | PG-13 | Drama | 133 | [u'Evan Rachel Wood', u'Jim Sturgess', u'Joe A... |
924 | 7.5 | Les Miserables | PG-13 | Crime | 134 | [u'Liam Neeson', u'Geoffrey Rush', u'Uma Thurm... |
925 | 7.5 | Notes on a Scandal | R | Drama | 92 | [u'Cate Blanchett', u'Judi Dench', u'Andrew Si... |
926 | 7.5 | Inside Llewyn Davis | R | Drama | 104 | [u'Oscar Isaac', u'Carey Mulligan', u'John Goo... |
927 | 7.5 | Brick | R | Crime | 110 | [u'Joseph Gordon-Levitt', u'Lukas Haas', u'Emi... |
931 | 7.4 | Mean Streets | R | Crime | 112 | [u'Robert De Niro', u'Harvey Keitel', u'David ... |
939 | 7.4 | Predestination | R | Drama | 97 | [u'Ethan Hawke', u'Sarah Snook', u'Noah Taylor'] |
941 | 7.4 | A Bridge Too Far | PG | Drama | 175 | [u'Sean Connery', u"Ryan O'Neal", u'Michael Ca... |
945 | 7.4 | Take Shelter | R | Drama | 120 | [u'Michael Shannon', u'Jessica Chastain', u'Sh... |
946 | 7.4 | Far from Heaven | PG-13 | Drama | 107 | [u'Julianne Moore', u'Dennis Quaid', u'Dennis ... |
947 | 7.4 | Eraserhead | UNRATED | Drama | 89 | [u'Jack Nance', u'Charlotte Stewart', u'Allen ... |
950 | 7.4 | Bound | R | Crime | 108 | [u'Jennifer Tilly', u'Gina Gershon', u'Joe Pan... |
951 | 7.4 | Sleepy Hollow | R | Drama | 105 | [u'Johnny Depp', u'Christina Ricci', u'Miranda... |
954 | 7.4 | X-Men | PG-13 | Action | 104 | [u'Patrick Stewart', u'Hugh Jackman', u'Ian Mc... |
955 | 7.4 | Zero Dark Thirty | R | Drama | 157 | [u'Jessica Chastain', u'Joel Edgerton', u'Chri... |
958 | 7.4 | My Sister's Keeper | PG-13 | Drama | 109 | [u'Cameron Diaz', u'Abigail Breslin', u'Alec B... |
963 | 7.4 | La Femme Nikita | R | Action | 118 | [u'Anne Parillaud', u'Marc Duret', u'Patrick F... |
967 | 7.4 | The Rock | R | Action | 136 | [u'Sean Connery', u'Nicolas Cage', u'Ed Harris'] |
968 | 7.4 | The English Patient | R | Drama | 162 | [u'Ralph Fiennes', u'Juliette Binoche', u'Will... |
969 | 7.4 | Law Abiding Citizen | R | Crime | 109 | [u'Gerard Butler', u'Jamie Foxx', u'Leslie Bibb'] |
970 | 7.4 | Wonder Boys | R | Drama | 107 | [u'Michael Douglas', u'Tobey Maguire', u'Franc... |
972 | 7.4 | Blue Valentine | NC-17 | Drama | 112 | [u'Ryan Gosling', u'Michelle Williams', u'John... |
973 | 7.4 | The Cider House Rules | PG-13 | Drama | 126 | [u'Tobey Maguire', u'Charlize Theron', u'Micha... |
976 | 7.4 | Master and Commander: The Far Side of the World | PG-13 | Action | 138 | [u'Russell Crowe', u'Paul Bettany', u'Billy Bo... |
978 | 7.4 | Wall Street | R | Crime | 126 | [u'Charlie Sheen', u'Michael Douglas', u'Tamar... |
538 rows × 6 columns
In [25]:
# fast method
filter_list = ['Crime', 'Drama', 'Action']
movies[movies.genre.isin(filter_list)]
Out[25]:
star_rating | title | content_rating | genre | duration | actors_list | |
---|---|---|---|---|---|---|
0 | 9.3 | The Shawshank Redemption | R | Crime | 142 | [u'Tim Robbins', u'Morgan Freeman', u'Bob Gunt... |
1 | 9.2 | The Godfather | R | Crime | 175 | [u'Marlon Brando', u'Al Pacino', u'James Caan'] |
2 | 9.1 | The Godfather: Part II | R | Crime | 200 | [u'Al Pacino', u'Robert De Niro', u'Robert Duv... |
3 | 9.0 | The Dark Knight | PG-13 | Action | 152 | [u'Christian Bale', u'Heath Ledger', u'Aaron E... |
4 | 8.9 | Pulp Fiction | R | Crime | 154 | [u'John Travolta', u'Uma Thurman', u'Samuel L.... |
5 | 8.9 | 12 Angry Men | NOT RATED | Drama | 96 | [u'Henry Fonda', u'Lee J. Cobb', u'Martin Bals... |
9 | 8.9 | Fight Club | R | Drama | 139 | [u'Brad Pitt', u'Edward Norton', u'Helena Bonh... |
11 | 8.8 | Inception | PG-13 | Action | 148 | [u'Leonardo DiCaprio', u'Joseph Gordon-Levitt'... |
12 | 8.8 | Star Wars: Episode V - The Empire Strikes Back | PG | Action | 124 | [u'Mark Hamill', u'Harrison Ford', u'Carrie Fi... |
13 | 8.8 | Forrest Gump | PG-13 | Drama | 142 | [u'Tom Hanks', u'Robin Wright', u'Gary Sinise'] |
16 | 8.7 | One Flew Over the Cuckoo's Nest | R | Drama | 133 | [u'Jack Nicholson', u'Louise Fletcher', u'Mich... |
17 | 8.7 | Seven Samurai | UNRATED | Drama | 207 | [u'Toshir\xf4 Mifune', u'Takashi Shimura', u'K... |
19 | 8.7 | Star Wars | PG | Action | 121 | [u'Mark Hamill', u'Harrison Ford', u'Carrie Fi... |
20 | 8.7 | The Matrix | R | Action | 136 | [u'Keanu Reeves', u'Laurence Fishburne', u'Car... |
21 | 8.7 | City of God | R | Crime | 130 | [u'Alexandre Rodrigues', u'Matheus Nachtergael... |
22 | 8.7 | It's a Wonderful Life | APPROVED | Drama | 130 | [u'James Stewart', u'Donna Reed', u'Lionel Bar... |
23 | 8.7 | The Usual Suspects | R | Crime | 106 | [u'Kevin Spacey', u'Gabriel Byrne', u'Chazz Pa... |
24 | 8.7 | Se7en | R | Drama | 127 | [u'Morgan Freeman', u'Brad Pitt', u'Kevin Spac... |
27 | 8.6 | The Silence of the Lambs | R | Drama | 118 | [u'Jodie Foster', u'Anthony Hopkins', u'Lawren... |
28 | 8.6 | Leon: The Professional | R | Crime | 110 | [u'Jean Reno', u'Gary Oldman', u'Natalie Portm... |
32 | 8.6 | Casablanca | PG | Drama | 102 | [u'Humphrey Bogart', u'Ingrid Bergman', u'Paul... |
33 | 8.6 | Whiplash | R | Drama | 107 | [u'Miles Teller', u'J.K. Simmons', u'Melissa B... |
34 | 8.6 | American History X | R | Crime | 119 | [u'Edward Norton', u'Edward Furlong', u"Beverl... |
36 | 8.6 | Saving Private Ryan | R | Action | 169 | [u'Tom Hanks', u'Matt Damon', u'Tom Sizemore'] |
37 | 8.6 | Raiders of the Lost Ark | PG | Action | 115 | [u'Harrison Ford', u'Karen Allen', u'Paul Free... |
40 | 8.5 | The Green Mile | R | Crime | 189 | [u'Tom Hanks', u'Michael Clarke Duncan', u'Dav... |
41 | 8.5 | Sunset Blvd. | NOT RATED | Drama | 110 | [u'William Holden', u'Gloria Swanson', u'Erich... |
43 | 8.5 | The Dark Knight Rises | PG-13 | Action | 165 | [u'Christian Bale', u'Tom Hardy', u'Anne Hatha... |
44 | 8.5 | Gladiator | R | Action | 155 | [u'Russell Crowe', u'Joaquin Phoenix', u'Conni... |
45 | 8.5 | Terminator 2: Judgment Day | R | Action | 137 | [u'Arnold Schwarzenegger', u'Linda Hamilton', ... |
... | ... | ... | ... | ... | ... | ... |
916 | 7.5 | Up in the Air | R | Drama | 109 | [u'George Clooney', u'Vera Farmiga', u'Anna Ke... |
917 | 7.5 | Begin Again | R | Drama | 104 | [u'Keira Knightley', u'Mark Ruffalo', u'Adam L... |
918 | 7.5 | Running Scared | R | Action | 122 | [u'Paul Walker', u'Cameron Bright', u'Chazz Pa... |
920 | 7.5 | Witness | R | Crime | 112 | [u'Harrison Ford', u'Kelly McGillis', u'Lukas ... |
922 | 7.5 | Mud | PG-13 | Drama | 130 | [u'Matthew McConaughey', u'Tye Sheridan', u'Ja... |
923 | 7.5 | Across the Universe | PG-13 | Drama | 133 | [u'Evan Rachel Wood', u'Jim Sturgess', u'Joe A... |
924 | 7.5 | Les Miserables | PG-13 | Crime | 134 | [u'Liam Neeson', u'Geoffrey Rush', u'Uma Thurm... |
925 | 7.5 | Notes on a Scandal | R | Drama | 92 | [u'Cate Blanchett', u'Judi Dench', u'Andrew Si... |
926 | 7.5 | Inside Llewyn Davis | R | Drama | 104 | [u'Oscar Isaac', u'Carey Mulligan', u'John Goo... |
927 | 7.5 | Brick | R | Crime | 110 | [u'Joseph Gordon-Levitt', u'Lukas Haas', u'Emi... |
931 | 7.4 | Mean Streets | R | Crime | 112 | [u'Robert De Niro', u'Harvey Keitel', u'David ... |
939 | 7.4 | Predestination | R | Drama | 97 | [u'Ethan Hawke', u'Sarah Snook', u'Noah Taylor'] |
941 | 7.4 | A Bridge Too Far | PG | Drama | 175 | [u'Sean Connery', u"Ryan O'Neal", u'Michael Ca... |
945 | 7.4 | Take Shelter | R | Drama | 120 | [u'Michael Shannon', u'Jessica Chastain', u'Sh... |
946 | 7.4 | Far from Heaven | PG-13 | Drama | 107 | [u'Julianne Moore', u'Dennis Quaid', u'Dennis ... |
947 | 7.4 | Eraserhead | UNRATED | Drama | 89 | [u'Jack Nance', u'Charlotte Stewart', u'Allen ... |
950 | 7.4 | Bound | R | Crime | 108 | [u'Jennifer Tilly', u'Gina Gershon', u'Joe Pan... |
951 | 7.4 | Sleepy Hollow | R | Drama | 105 | [u'Johnny Depp', u'Christina Ricci', u'Miranda... |
954 | 7.4 | X-Men | PG-13 | Action | 104 | [u'Patrick Stewart', u'Hugh Jackman', u'Ian Mc... |
955 | 7.4 | Zero Dark Thirty | R | Drama | 157 | [u'Jessica Chastain', u'Joel Edgerton', u'Chri... |
958 | 7.4 | My Sister's Keeper | PG-13 | Drama | 109 | [u'Cameron Diaz', u'Abigail Breslin', u'Alec B... |
963 | 7.4 | La Femme Nikita | R | Action | 118 | [u'Anne Parillaud', u'Marc Duret', u'Patrick F... |
967 | 7.4 | The Rock | R | Action | 136 | [u'Sean Connery', u'Nicolas Cage', u'Ed Harris'] |
968 | 7.4 | The English Patient | R | Drama | 162 | [u'Ralph Fiennes', u'Juliette Binoche', u'Will... |
969 | 7.4 | Law Abiding Citizen | R | Crime | 109 | [u'Gerard Butler', u'Jamie Foxx', u'Leslie Bibb'] |
970 | 7.4 | Wonder Boys | R | Drama | 107 | [u'Michael Douglas', u'Tobey Maguire', u'Franc... |
972 | 7.4 | Blue Valentine | NC-17 | Drama | 112 | [u'Ryan Gosling', u'Michelle Williams', u'John... |
973 | 7.4 | The Cider House Rules | PG-13 | Drama | 126 | [u'Tobey Maguire', u'Charlize Theron', u'Micha... |
976 | 7.4 | Master and Commander: The Far Side of the World | PG-13 | Action | 138 | [u'Russell Crowe', u'Paul Bettany', u'Billy Bo... |
978 | 7.4 | Wall Street | R | Crime | 126 | [u'Charlie Sheen', u'Michael Douglas', u'Tamar... |
538 rows × 6 columns
Tags:
pandas