Sorting Pandas DataFrame or Series
This introduction to pandas is derived from Data School's pandas Q&A with my own notes and code.
Sorting Pandas DataFrame or Series¶
In [1]:
import pandas as pd
In [2]:
url = 'http://bit.ly/imdbratings'
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 [6]:
# sort using sort_values
# sort with numbers first then alphabetical order
movies.title.sort_values()
# alternative sorting
movies['title'].sort_values()
Out[6]:
542 (500) Days of Summer
5 12 Angry Men
201 12 Years a Slave
698 127 Hours
110 2001: A Space Odyssey
910 2046
596 21 Grams
624 25th Hour
708 28 Days Later...
60 3 Idiots
225 3-Iron
570 300
555 3:10 to Yuma
427 4 Months, 3 Weeks and 2 Days
824 42
597 50/50
203 8 1/2
170 A Beautiful Mind
941 A Bridge Too Far
571 A Bronx Tale
266 A Christmas Story
86 A Clockwork Orange
716 A Few Good Men
750 A Fish Called Wanda
276 A Fistful of Dollars
612 A Hard Day's Night
883 A History of Violence
869 A Nightmare on Elm Street
865 A Perfect World
426 A Prophet
...
207 What Ever Happened to Baby Jane?
562 What's Eating Gilbert Grape
719 When Harry Met Sally...
649 Where Eagles Dare
33 Whiplash
669 Who Framed Roger Rabbit
219 Who's Afraid of Virginia Woolf?
127 Wild Strawberries
497 Willy Wonka & the Chocolate Factory
270 Wings of Desire
483 Withnail & I
920 Witness
65 Witness for the Prosecution
970 Wonder Boys
518 Wreck-It Ralph
954 X-Men
248 X-Men: Days of Future Past
532 X-Men: First Class
871 X2
695 Y Tu Mama Tambien
403 Ying xiong
235 Yip Man
96 Yojimbo
280 Young Frankenstein
535 Zelig
955 Zero Dark Thirty
677 Zodiac
615 Zombieland
526 Zulu
864 [Rec]
Name: title, dtype: object
In [7]:
# returns a series
type(movies['title'].sort_values())
Out[7]:
pandas.core.series.Series
Sort Column
In [8]:
# sort in ascending=False
# this does not affect the underlying data
movies.title.sort_values(ascending=False)
Out[8]:
864 [Rec]
526 Zulu
615 Zombieland
677 Zodiac
955 Zero Dark Thirty
535 Zelig
280 Young Frankenstein
96 Yojimbo
235 Yip Man
403 Ying xiong
695 Y Tu Mama Tambien
871 X2
532 X-Men: First Class
248 X-Men: Days of Future Past
954 X-Men
518 Wreck-It Ralph
970 Wonder Boys
65 Witness for the Prosecution
920 Witness
483 Withnail & I
270 Wings of Desire
497 Willy Wonka & the Chocolate Factory
127 Wild Strawberries
219 Who's Afraid of Virginia Woolf?
669 Who Framed Roger Rabbit
33 Whiplash
649 Where Eagles Dare
719 When Harry Met Sally...
562 What's Eating Gilbert Grape
207 What Ever Happened to Baby Jane?
...
426 A Prophet
865 A Perfect World
869 A Nightmare on Elm Street
883 A History of Violence
612 A Hard Day's Night
276 A Fistful of Dollars
750 A Fish Called Wanda
716 A Few Good Men
86 A Clockwork Orange
266 A Christmas Story
571 A Bronx Tale
941 A Bridge Too Far
170 A Beautiful Mind
203 8 1/2
597 50/50
824 42
427 4 Months, 3 Weeks and 2 Days
555 3:10 to Yuma
570 300
225 3-Iron
60 3 Idiots
708 28 Days Later...
624 25th Hour
596 21 Grams
910 2046
110 2001: A Space Odyssey
698 127 Hours
201 12 Years a Slave
5 12 Angry Men
542 (500) Days of Summer
Name: title, dtype: object
Sort DataFrame using a particular column
In [9]:
movies.sort_values('title')
Out[9]:
| star_rating | title | content_rating | genre | duration | actors_list | |
|---|---|---|---|---|---|---|
| 542 | 7.8 | (500) Days of Summer | PG-13 | Comedy | 95 | [u'Zooey Deschanel', u'Joseph Gordon-Levitt', ... |
| 5 | 8.9 | 12 Angry Men | NOT RATED | Drama | 96 | [u'Henry Fonda', u'Lee J. Cobb', u'Martin Bals... |
| 201 | 8.1 | 12 Years a Slave | R | Biography | 134 | [u'Chiwetel Ejiofor', u'Michael Kenneth Willia... |
| 698 | 7.6 | 127 Hours | R | Adventure | 94 | [u'James Franco', u'Amber Tamblyn', u'Kate Mara'] |
| 110 | 8.3 | 2001: A Space Odyssey | G | Mystery | 160 | [u'Keir Dullea', u'Gary Lockwood', u'William S... |
| 910 | 7.5 | 2046 | R | Drama | 129 | [u'Tony Chiu Wai Leung', u'Ziyi Zhang', u'Faye... |
| 596 | 7.7 | 21 Grams | R | Crime | 124 | [u'Sean Penn', u'Benicio Del Toro', u'Naomi Wa... |
| 624 | 7.7 | 25th Hour | R | Crime | 135 | [u'Edward Norton', u'Barry Pepper', u'Philip S... |
| 708 | 7.6 | 28 Days Later... | R | Horror | 113 | [u'Cillian Murphy', u'Naomie Harris', u'Christ... |
| 60 | 8.5 | 3 Idiots | PG-13 | Comedy | 170 | [u'Aamir Khan', u'Madhavan', u'Mona Singh'] |
| 225 | 8.1 | 3-Iron | R | Crime | 88 | [u'Seung-yeon Lee', u'Hyun-kyoon Lee', u'Hyuk-... |
| 570 | 7.8 | 300 | R | Action | 117 | [u'Gerard Butler', u'Lena Headey', u'David Wen... |
| 555 | 7.8 | 3:10 to Yuma | R | Adventure | 122 | [u'Russell Crowe', u'Christian Bale', u'Ben Fo... |
| 427 | 7.9 | 4 Months, 3 Weeks and 2 Days | NOT RATED | Drama | 113 | [u'Anamaria Marinca', u'Vlad Ivanov', u'Laura ... |
| 824 | 7.5 | 42 | PG-13 | Biography | 128 | [u'Chadwick Boseman', u'T.R. Knight', u'Harris... |
| 597 | 7.7 | 50/50 | R | Comedy | 100 | [u'Joseph Gordon-Levitt', u'Seth Rogen', u'Ann... |
| 203 | 8.1 | 8 1/2 | NOT RATED | Drama | 138 | [u'Marcello Mastroianni', u'Anouk Aim\xe9e', u... |
| 170 | 8.2 | A Beautiful Mind | PG-13 | Biography | 135 | [u'Russell Crowe', u'Ed Harris', u'Jennifer Co... |
| 941 | 7.4 | A Bridge Too Far | PG | Drama | 175 | [u'Sean Connery', u"Ryan O'Neal", u'Michael Ca... |
| 571 | 7.8 | A Bronx Tale | R | Crime | 121 | [u'Robert De Niro', u'Chazz Palminteri', u'Lil... |
| 266 | 8.1 | A Christmas Story | PG | Comedy | 94 | [u'Peter Billingsley', u'Melinda Dillon', u'Da... |
| 86 | 8.4 | A Clockwork Orange | X | Crime | 136 | [u'Malcolm McDowell', u'Patrick Magee', u'Mich... |
| 716 | 7.6 | A Few Good Men | R | Drama | 138 | [u'Tom Cruise', u'Jack Nicholson', u'Demi Moore'] |
| 750 | 7.6 | A Fish Called Wanda | R | Comedy | 108 | [u'John Cleese', u'Jamie Lee Curtis', u'Kevin ... |
| 276 | 8.1 | A Fistful of Dollars | R | Action | 99 | [u'Clint Eastwood', u'Gian Maria Volont\xe9', ... |
| 612 | 7.7 | A Hard Day's Night | APPROVED | Comedy | 87 | [u'John Lennon', u'Paul McCartney', u'George H... |
| 883 | 7.5 | A History of Violence | R | Crime | 96 | [u'Viggo Mortensen', u'Maria Bello', u'Ed Harr... |
| 869 | 7.5 | A Nightmare on Elm Street | R | Horror | 91 | [u'Heather Langenkamp', u'Johnny Depp', u'Robe... |
| 865 | 7.5 | A Perfect World | PG-13 | Crime | 138 | [u'Kevin Costner', u'Clint Eastwood', u'Laura ... |
| 426 | 7.9 | A Prophet | R | Crime | 155 | [u'Tahar Rahim', u'Niels Arestrup', u'Adel Ben... |
| ... | ... | ... | ... | ... | ... | ... |
| 207 | 8.1 | What Ever Happened to Baby Jane? | APPROVED | Drama | 134 | [u'Bette Davis', u'Joan Crawford', u'Victor Bu... |
| 562 | 7.8 | What's Eating Gilbert Grape | PG-13 | Drama | 118 | [u'Johnny Depp', u'Leonardo DiCaprio', u'Julie... |
| 719 | 7.6 | When Harry Met Sally... | R | Comedy | 96 | [u'Billy Crystal', u'Meg Ryan', u'Carrie Fisher'] |
| 649 | 7.7 | Where Eagles Dare | NaN | Action | 158 | [u'Richard Burton', u'Clint Eastwood', u'Mary ... |
| 33 | 8.6 | Whiplash | R | Drama | 107 | [u'Miles Teller', u'J.K. Simmons', u'Melissa B... |
| 669 | 7.7 | Who Framed Roger Rabbit | PG | Animation | 104 | [u'Bob Hoskins', u'Christopher Lloyd', u'Joann... |
| 219 | 8.1 | Who's Afraid of Virginia Woolf? | TV-MA | Drama | 131 | [u'Elizabeth Taylor', u'Richard Burton', u'Geo... |
| 127 | 8.3 | Wild Strawberries | UNRATED | Drama | 91 | [u'Victor Sj\xf6str\xf6m', u'Bibi Andersson', ... |
| 497 | 7.8 | Willy Wonka & the Chocolate Factory | G | Family | 100 | [u'Gene Wilder', u'Jack Albertson', u'Peter Os... |
| 270 | 8.1 | Wings of Desire | PG-13 | Drama | 128 | [u'Bruno Ganz', u'Solveig Dommartin', u'Otto S... |
| 483 | 7.8 | Withnail & I | R | Comedy | 107 | [u'Richard E. Grant', u'Paul McGann', u'Richar... |
| 920 | 7.5 | Witness | R | Crime | 112 | [u'Harrison Ford', u'Kelly McGillis', u'Lukas ... |
| 65 | 8.4 | Witness for the Prosecution | APPROVED | Crime | 116 | [u'Tyrone Power', u'Marlene Dietrich', u'Charl... |
| 970 | 7.4 | Wonder Boys | R | Drama | 107 | [u'Michael Douglas', u'Tobey Maguire', u'Franc... |
| 518 | 7.8 | Wreck-It Ralph | PG | Animation | 101 | [u'John C. Reilly', u'Jack McBrayer', u'Jane L... |
| 954 | 7.4 | X-Men | PG-13 | Action | 104 | [u'Patrick Stewart', u'Hugh Jackman', u'Ian Mc... |
| 248 | 8.1 | X-Men: Days of Future Past | PG-13 | Action | 131 | [u'Patrick Stewart', u'Ian McKellen', u'Hugh J... |
| 532 | 7.8 | X-Men: First Class | PG-13 | Action | 132 | [u'James McAvoy', u'Michael Fassbender', u'Jen... |
| 871 | 7.5 | X2 | PG-13 | Action | 134 | [u'Patrick Stewart', u'Hugh Jackman', u'Halle ... |
| 695 | 7.7 | Y Tu Mama Tambien | R | Drama | 106 | [u'Maribel Verd\xfa', u'Gael Garc\xeda Bernal'... |
| 403 | 7.9 | Ying xiong | PG-13 | Action | 99 | [u'Jet Li', u'Tony Chiu Wai Leung', u'Maggie C... |
| 235 | 8.1 | Yip Man | R | Action | 106 | [u'Donnie Yen', u'Simon Yam', u'Siu-Wong Fan'] |
| 96 | 8.4 | Yojimbo | UNRATED | Action | 110 | [u'Toshir\xf4 Mifune', u'Eijir\xf4 T\xf4no', u... |
| 280 | 8.1 | Young Frankenstein | PG | Comedy | 106 | [u'Gene Wilder', u'Madeline Kahn', u'Marty Fel... |
| 535 | 7.8 | Zelig | PG | Comedy | 79 | [u'Woody Allen', u'Mia Farrow', u'Patrick Horg... |
| 955 | 7.4 | Zero Dark Thirty | R | Drama | 157 | [u'Jessica Chastain', u'Joel Edgerton', u'Chri... |
| 677 | 7.7 | Zodiac | R | Crime | 157 | [u'Jake Gyllenhaal', u'Robert Downey Jr.', u'M... |
| 615 | 7.7 | Zombieland | R | Comedy | 88 | [u'Jesse Eisenberg', u'Emma Stone', u'Woody Ha... |
| 526 | 7.8 | Zulu | UNRATED | Drama | 138 | [u'Stanley Baker', u'Jack Hawkins', u'Ulla Jac... |
| 864 | 7.5 | [Rec] | R | Horror | 78 | [u'Manuela Velasco', u'Ferran Terraza', u'Jorg... |
979 rows × 6 columns
In [11]:
movies.sort_values('duration', ascending=False)
Out[11]:
| star_rating | title | content_rating | genre | duration | actors_list | |
|---|---|---|---|---|---|---|
| 476 | 7.8 | Hamlet | PG-13 | Drama | 242 | [u'Kenneth Branagh', u'Julie Christie', u'Dere... |
| 157 | 8.2 | Gone with the Wind | G | Drama | 238 | [u'Clark Gable', u'Vivien Leigh', u'Thomas Mit... |
| 78 | 8.4 | Once Upon a Time in America | R | Crime | 229 | [u'Robert De Niro', u'James Woods', u'Elizabet... |
| 142 | 8.3 | Lagaan: Once Upon a Time in India | PG | Adventure | 224 | [u'Aamir Khan', u'Gracy Singh', u'Rachel Shell... |
| 445 | 7.9 | The Ten Commandments | APPROVED | Adventure | 220 | [u'Charlton Heston', u'Yul Brynner', u'Anne Ba... |
| 85 | 8.4 | Lawrence of Arabia | PG | Adventure | 216 | [u"Peter O'Toole", u'Alec Guinness', u'Anthony... |
| 204 | 8.1 | Ben-Hur | G | Adventure | 212 | [u'Charlton Heston', u'Jack Hawkins', u'Stephe... |
| 17 | 8.7 | Seven Samurai | UNRATED | Drama | 207 | [u'Toshir\xf4 Mifune', u'Takashi Shimura', u'K... |
| 767 | 7.6 | It's a Mad, Mad, Mad, Mad World | APPROVED | Action | 205 | [u'Spencer Tracy', u'Milton Berle', u'Ethel Me... |
| 630 | 7.7 | Malcolm X | PG-13 | Biography | 202 | [u'Denzel Washington', u'Angela Bassett', u'De... |
| 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... |
| 2 | 9.1 | The Godfather: Part II | R | Crime | 200 | [u'Al Pacino', u'Robert De Niro', u'Robert Duv... |
| 335 | 8.0 | Doctor Zhivago | PG-13 | Drama | 197 | [u'Omar Sharif', u'Julie Christie', u'Geraldin... |
| 385 | 8.0 | Spartacus | PG-13 | Action | 197 | [u'Kirk Douglas', u'Laurence Olivier', u'Jean ... |
| 8 | 8.9 | Schindler's List | R | Biography | 195 | [u'Liam Neeson', u'Ralph Fiennes', u'Ben Kings... |
| 620 | 7.7 | Titanic | PG-13 | Drama | 194 | [u'Leonardo DiCaprio', u'Kate Winslet', u'Bill... |
| 424 | 7.9 | The Right Stuff | R | Adventure | 193 | [u'Sam Shepard', u'Scott Glenn', u'Ed Harris'] |
| 220 | 8.1 | Gandhi | PG | Biography | 191 | [u'Ben Kingsley', u'John Gielgud', u'Candice B... |
| 671 | 7.7 | Grindhouse | R | Action | 191 | [u'Kurt Russell', u'Rose McGowan', u'Danny Tre... |
| 89 | 8.4 | Swades | NOT RATED | Drama | 189 | [u'Shah Rukh Khan', u'Gayatri Joshi', u'Kishor... |
| 40 | 8.5 | The Green Mile | R | Crime | 189 | [u'Tom Hanks', u'Michael Clarke Duncan', u'Dav... |
| 316 | 8.0 | JFK | R | Drama | 189 | [u'Kevin Costner', u'Gary Oldman', u'Jack Lemm... |
| 184 | 8.2 | Fanny and Alexander | R | Drama | 188 | [u'Bertil Guve', u'Pernilla Allwin', u'Kristin... |
| 318 | 8.0 | Magnolia | R | Drama | 188 | [u'Tom Cruise', u'Jason Robards', u'Julianne M... |
| 611 | 7.7 | Short Cuts | R | Comedy | 187 | [u'Andie MacDowell', u'Julianne Moore', u'Tim ... |
| 132 | 8.3 | Judgment at Nuremberg | NOT RATED | Drama | 186 | [u'Spencer Tracy', u'Burt Lancaster', u'Richar... |
| 245 | 8.1 | Barry Lyndon | PG | Adventure | 184 | [u"Ryan O'Neal", u'Marisa Berenson', u'Patrick... |
| 109 | 8.3 | Dil Chahta Hai | NOT RATED | Comedy | 183 | [u'Aamir Khan', u'Saif Ali Khan', u'Akshaye Kh... |
| 166 | 8.2 | The Deer Hunter | R | Drama | 182 | [u'Robert De Niro', u'Christopher Walken', u'J... |
| 93 | 8.4 | Dilwale Dulhania Le Jayenge | NOT RATED | Comedy | 181 | [u'Shah Rukh Khan', u'Kajol', u'Amrish Puri'] |
| ... | ... | ... | ... | ... | ... | ... |
| 881 | 7.5 | The Texas Chain Saw Massacre | R | Horror | 83 | [u'Marilyn Burns', u'Edwin Neal', u'Allen Danz... |
| 766 | 7.6 | The Little Mermaid | G | Animation | 83 | [u'Jodi Benson', u'Samuel E. Wright', u'Rene A... |
| 174 | 8.2 | Persona | NOT RATED | Drama | 83 | [u'Bibi Andersson', u'Liv Ullmann', u'Margaret... |
| 306 | 8.0 | This Is Spinal Tap | R | Comedy | 82 | [u'Rob Reiner', u'Michael McKean', u'Christoph... |
| 595 | 7.7 | The Purple Rose of Cairo | PG | Comedy | 82 | [u'Mia Farrow', u'Jeff Daniels', u'Danny Aiello'] |
| 738 | 7.6 | Army of Darkness | R | Comedy | 81 | [u'Bruce Campbell', u'Embeth Davidtz', u'Marcu... |
| 541 | 7.8 | South Park: Bigger Longer & Uncut | R | Animation | 81 | [u'Trey Parker', u'Matt Stone', u'Mary Kay Ber... |
| 117 | 8.3 | Toy Story | G | Animation | 81 | [u'Tom Hanks', u'Tim Allen', u'Don Rickles'] |
| 789 | 7.6 | Ice Age | PG | Animation | 81 | [u'Denis Leary', u'John Leguizamo', u'Ray Roma... |
| 330 | 8.0 | Nosferatu | UNRATED | Horror | 81 | [u'Max Schreck', u'Greta Schr\xf6der', u'Ruth ... |
| 853 | 7.5 | L'illusionniste | PG | Animation | 80 | [u'Jean-Claude Donda', u'Eilidh Rankin', u'Dun... |
| 297 | 8.0 | Rope | PG | Crime | 80 | [u'James Stewart', u'John Dall', u'Farley Gran... |
| 283 | 8.1 | Before Sunset | R | Drama | 80 | [u'Ethan Hawke', u'Julie Delpy', u'Vernon Dobt... |
| 513 | 7.8 | Invasion of the Body Snatchers | APPROVED | Horror | 80 | [u'Kevin McCarthy', u'Dana Wynter', u'Larry Ga... |
| 533 | 7.8 | Run Lola Run | R | Action | 80 | [u'Franka Potente', u'Moritz Bleibtreu', u'Her... |
| 622 | 7.7 | The Dinner Game | PG-13 | Comedy | 80 | [u'Thierry Lhermitte', u'Jacques Villeret', u'... |
| 535 | 7.8 | Zelig | PG | Comedy | 79 | [u'Woody Allen', u'Mia Farrow', u'Patrick Horg... |
| 489 | 7.8 | The Triplets of Belleville | PG-13 | Animation | 78 | [u'Mich\xe8le Caucheteux', u'Jean-Claude Donda... |
| 864 | 7.5 | [Rec] | R | Horror | 78 | [u'Manuela Velasco', u'Ferran Terraza', u'Jorg... |
| 713 | 7.6 | The Jungle Book | APPROVED | Animation | 78 | [u'Phil Harris', u'Sebastian Cabot', u'Louis P... |
| 303 | 8.0 | The Nightmare Before Christmas | PG | Animation | 76 | [u'Danny Elfman', u'Chris Sarandon', u"Catheri... |
| 405 | 7.9 | The Bride of Frankenstein | NOT RATED | Horror | 75 | [u'Boris Karloff', u'Elsa Lanchester', u'Colin... |
| 938 | 7.4 | Alice in Wonderland | G | Animation | 75 | [u'Kathryn Beaumont', u'Ed Wynn', u'Richard Ha... |
| 351 | 8.0 | Frankenstein | UNRATED | Horror | 70 | [u'Colin Clive', u'Mae Clarke', u'Boris Karloff'] |
| 742 | 7.6 | Following | R | Mystery | 69 | [u'Jeremy Theobald', u'Alex Haw', u'Lucy Russe... |
| 293 | 8.1 | Duck Soup | PASSED | Comedy | 68 | [u'Groucho Marx', u'Harpo Marx', u'Chico Marx'] |
| 88 | 8.4 | The Kid | NOT RATED | Comedy | 68 | [u'Charles Chaplin', u'Edna Purviance', u'Jack... |
| 258 | 8.1 | The Cabinet of Dr. Caligari | UNRATED | Crime | 67 | [u'Werner Krauss', u'Conrad Veidt', u'Friedric... |
| 338 | 8.0 | Battleship Potemkin | UNRATED | History | 66 | [u'Aleksandr Antonov', u'Vladimir Barsky', u'G... |
| 389 | 8.0 | Freaks | UNRATED | Drama | 64 | [u'Wallace Ford', u'Leila Hyams', u'Olga Bacla... |
979 rows × 6 columns
Sorting a DataFrame using multiple columns
In [12]:
# create list of columns
# sort using content_rating
# then within content_rating, sort by duration
columns = ['content_rating', 'duration']
# sort column
movies.sort_values(columns)
Out[12]:
| star_rating | title | content_rating | genre | duration | actors_list | |
|---|---|---|---|---|---|---|
| 713 | 7.6 | The Jungle Book | APPROVED | Animation | 78 | [u'Phil Harris', u'Sebastian Cabot', u'Louis P... |
| 513 | 7.8 | Invasion of the Body Snatchers | APPROVED | Horror | 80 | [u'Kevin McCarthy', u'Dana Wynter', u'Larry Ga... |
| 272 | 8.1 | The Killing | APPROVED | Crime | 85 | [u'Sterling Hayden', u'Coleen Gray', u'Vince E... |
| 703 | 7.6 | Dracula | APPROVED | Horror | 85 | [u'Bela Lugosi', u'Helen Chandler', u'David Ma... |
| 612 | 7.7 | A Hard Day's Night | APPROVED | Comedy | 87 | [u'John Lennon', u'Paul McCartney', u'George H... |
| 58 | 8.5 | Paths of Glory | APPROVED | Drama | 88 | [u'Kirk Douglas', u'Ralph Meeker', u'Adolphe M... |
| 210 | 8.1 | Laura | APPROVED | Film-Noir | 88 | [u'Gene Tierney', u'Dana Andrews', u'Clifton W... |
| 656 | 7.7 | Snow White and the Seven Dwarfs | APPROVED | Animation | 88 | [u'Adriana Caselotti', u'Harry Stockwell', u'L... |
| 844 | 7.5 | Pinocchio | APPROVED | Animation | 88 | [u'Dickie Jones', u'Christian Rub', u'Mel Blanc'] |
| 233 | 8.1 | The Night of the Hunter | APPROVED | Crime | 92 | [u'Robert Mitchum', u'Shelley Winters', u'Lill... |
| 287 | 8.1 | His Girl Friday | APPROVED | Comedy | 92 | [u'Cary Grant', u'Rosalind Russell', u'Ralph B... |
| 484 | 7.8 | The Day the Earth Stood Still | APPROVED | Sci-Fi | 92 | [u'Michael Rennie', u'Patricia Neal', u'Hugh M... |
| 451 | 7.9 | Miracle on 34th Street | APPROVED | Comedy | 96 | [u'Edmund Gwenn', u"Maureen O'Hara", u'John Pa... |
| 229 | 8.1 | Strangers on a Train | APPROVED | Crime | 101 | [u'Farley Granger', u'Robert Walker', u'Ruth R... |
| 237 | 8.1 | Notorious | APPROVED | Drama | 101 | [u'Cary Grant', u'Ingrid Bergman', u'Claude Ra... |
| 521 | 7.8 | Belle de Jour | APPROVED | Drama | 101 | [u'Catherine Deneuve', u'Jean Sorel', u'Michel... |
| 285 | 8.1 | Bringing Up Baby | APPROVED | Comedy | 102 | [u'Katharine Hepburn', u'Cary Grant', u'Charle... |
| 94 | 8.4 | Singin' in the Rain | APPROVED | Comedy | 103 | [u'Gene Kelly', u"Donald O'Connor", u'Debbie R... |
| 575 | 7.8 | Kramer vs. Kramer | APPROVED | Drama | 105 | [u'Dustin Hoffman', u'Meryl Streep', u'Jane Al... |
| 298 | 8.0 | The Graduate | APPROVED | Comedy | 106 | [u'Dustin Hoffman', u'Anne Bancroft', u'Kathar... |
| 866 | 7.5 | To Catch a Thief | APPROVED | Mystery | 106 | [u'Cary Grant', u'Grace Kelly', u'Jessie Royce... |
| 230 | 8.1 | Cat on a Hot Tin Roof | APPROVED | Drama | 108 | [u'Elizabeth Taylor', u'Paul Newman', u'Burl I... |
| 350 | 8.0 | Shadow of a Doubt | APPROVED | Thriller | 108 | [u'Teresa Wright', u'Joseph Cotten', u'Macdona... |
| 329 | 8.0 | In the Heat of the Night | APPROVED | Crime | 109 | [u'Sidney Poitier', u'Rod Steiger', u'Warren O... |
| 563 | 7.8 | Goldfinger | APPROVED | Action | 110 | [u'Sean Connery', u'Gert Fr\xf6be', u'Honor Bl... |
| 410 | 7.9 | Bonnie and Clyde | APPROVED | Biography | 111 | [u'Warren Beatty', u'Faye Dunaway', u'Michael ... |
| 38 | 8.6 | Rear Window | APPROVED | Mystery | 112 | [u'James Stewart', u'Grace Kelly', u'Wendell C... |
| 253 | 8.1 | The Big Sleep | APPROVED | Crime | 114 | [u'Humphrey Bogart', u'Lauren Bacall', u'John ... |
| 896 | 7.5 | From Russia with Love | APPROVED | Action | 115 | [u'Sean Connery', u'Robert Shaw', u'Lotte Lenya'] |
| 65 | 8.4 | Witness for the Prosecution | APPROVED | Crime | 116 | [u'Tyrone Power', u'Marlene Dietrich', u'Charl... |
| ... | ... | ... | ... | ... | ... | ... |
| 652 | 7.7 | This Is England | UNRATED | Crime | 101 | [u'Thomas Turgoose', u'Stephen Graham', u'Jo H... |
| 144 | 8.2 | It Happened One Night | UNRATED | Comedy | 105 | [u'Clark Gable', u'Claudette Colbert', u'Walte... |
| 291 | 8.1 | The Return | UNRATED | Drama | 105 | [u'Vladimir Garin', u'Ivan Dobronravov', u'Kon... |
| 523 | 7.8 | Repulsion | UNRATED | Drama | 105 | [u'Catherine Deneuve', u'Ian Hendry', u'John F... |
| 123 | 8.3 | The General | UNRATED | Action | 107 | [u'Buster Keaton', u'Marion Mack', u'Glen Cave... |
| 472 | 7.8 | Guess Who's Coming to Dinner | UNRATED | Comedy | 108 | [u'Spencer Tracy', u'Sidney Poitier', u'Kathar... |
| 757 | 7.6 | Funny Games | UNRATED | Crime | 108 | [u'Susanne Lothar', u'Ulrich M\xfche', u'Arno ... |
| 96 | 8.4 | Yojimbo | UNRATED | Action | 110 | [u'Toshir\xf4 Mifune', u'Eijir\xf4 T\xf4no', u... |
| 687 | 7.7 | Spellbound | UNRATED | Film-Noir | 111 | [u'Ingrid Bergman', u'Gregory Peck', u'Michael... |
| 582 | 7.8 | Sabrina | UNRATED | Comedy | 113 | [u'Humphrey Bogart', u'Audrey Hepburn', u'Will... |
| 823 | 7.5 | Straw Dogs | UNRATED | Crime | 113 | [u'Dustin Hoffman', u'Susan George', u'Peter V... |
| 239 | 8.1 | Elite Squad: The Enemy Within | UNRATED | Action | 115 | [u'Wagner Moura', u'Irandhir Santos', u'Andr\x... |
| 161 | 8.2 | Diabolique | UNRATED | Horror | 116 | [u'Simone Signoret', u'V\xe9ra Clouzot', u'Pau... |
| 317 | 8.0 | Dawn of the Dead | UNRATED | Horror | 127 | [u'David Emge', u'Ken Foree', u'Scott H. Reini... |
| 802 | 7.6 | Tell No One | UNRATED | Crime | 131 | [u'Fran\xe7ois Cluzet', u'Marie-Jos\xe9e Croze... |
| 217 | 8.1 | Memories of Murder | UNRATED | Crime | 132 | [u'Kang-ho Song', u'Sang-kyung Kim', u'Roe-ha ... |
| 262 | 8.1 | The Hustler | UNRATED | Drama | 134 | [u'Paul Newman', u'Jackie Gleason', u'Piper La... |
| 289 | 8.1 | All Quiet on the Western Front | UNRATED | Drama | 136 | [u'Lew Ayres', u'Louis Wolheim', u'John Wray'] |
| 526 | 7.8 | Zulu | UNRATED | Drama | 138 | [u'Stanley Baker', u'Jack Hawkins', u'Ulla Jac... |
| 730 | 7.6 | West Side Story | UNRATED | Crime | 152 | [u'Natalie Wood', u'George Chakiris', u'Richar... |
| 257 | 8.1 | Anatomy of a Murder | UNRATED | Crime | 160 | [u'James Stewart', u'Lee Remick', u'Ben Gazzara'] |
| 120 | 8.3 | The Great Escape | UNRATED | Adventure | 172 | [u'Steve McQueen', u'James Garner', u'Richard ... |
| 17 | 8.7 | Seven Samurai | UNRATED | Drama | 207 | [u'Toshir\xf4 Mifune', u'Takashi Shimura', u'K... |
| 486 | 7.8 | Evil Dead II | X | Comedy | 84 | [u'Bruce Campbell', u'Sarah Berry', u'Dan Hicks'] |
| 913 | 7.5 | Suspiria | X | Horror | 92 | [u'Jessica Harper', u'Stefania Casini', u'Flav... |
| 387 | 8.0 | Midnight Cowboy | X | Drama | 113 | [u'Dustin Hoffman', u'Jon Voight', u'Sylvia Mi... |
| 86 | 8.4 | A Clockwork Orange | X | Crime | 136 | [u'Malcolm McDowell', u'Patrick Magee', u'Mich... |
| 187 | 8.2 | Butch Cassidy and the Sundance Kid | NaN | Biography | 110 | [u'Paul Newman', u'Robert Redford', u'Katharin... |
| 936 | 7.4 | True Grit | NaN | Adventure | 128 | [u'John Wayne', u'Kim Darby', u'Glen Campbell'] |
| 649 | 7.7 | Where Eagles Dare | NaN | Action | 158 | [u'Richard Burton', u'Clint Eastwood', u'Mary ... |
979 rows × 6 columns
Tags:
pandas