diff --git a/All.ipynb b/All.ipynb index d42518b..21c6a6b 100644 --- a/All.ipynb +++ b/All.ipynb @@ -6399,21 +6399,1334 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 228, "metadata": { - "collapsed": true + "collapsed": false }, - "outputs": [], - "source": [] + "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", + "
titleyearnametypecharactern
0The Core2003Alejandro AbellanactorU.S.S. SoldierNaN
1Il momento di uccidere1968Remo De AngelisactorDago9
2Across the Divide1921Thomas DelmaractorDago4
3Revan2012Diego JamesactorDagoNaN
4Un homme marche dans la ville1950Fabien LorisactorDago12
\n", + "
" + ], + "text/plain": [ + " title year name type \\\n", + "0 The Core 2003 Alejandro Abellan actor \n", + "1 Il momento di uccidere 1968 Remo De Angelis actor \n", + "2 Across the Divide 1921 Thomas Delmar actor \n", + "3 Revan 2012 Diego James actor \n", + "4 Un homme marche dans la ville 1950 Fabien Loris actor \n", + "\n", + " character n \n", + "0 U.S.S. Soldier NaN \n", + "1 Dago 9 \n", + "2 Dago 4 \n", + "3 Dago NaN \n", + "4 Dago 12 " + ] + }, + "execution_count": 228, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "cast.head()" + ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 243, "metadata": { - "collapsed": true + "collapsed": false }, - "outputs": [], - "source": [] + "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", + "
titleyear
0The Core2003
1Il momento di uccidere1968
2Across the Divide1921
3Revan2012
4Un homme marche dans la ville1950
\n", + "
" + ], + "text/plain": [ + " title year\n", + "0 The Core 2003\n", + "1 Il momento di uccidere 1968\n", + "2 Across the Divide 1921\n", + "3 Revan 2012\n", + "4 Un homme marche dans la ville 1950" + ] + }, + "execution_count": 243, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "t = titles\n", + "\n", + "t.head()" + ] + }, + { + "cell_type": "code", + "execution_count": 246, + "metadata": { + "collapsed": false + }, + "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", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
titlenametypen
yearcharacter
1964LadyHamletKate BeswickactressNaN
LadyHamletCarol TeitelactressNaN
2000Special Guest AppearanceHamletPaul Ferriteractor23
Special Guest AppearanceHamletPaul Graham (IV)actor27
Special Guest AppearanceHamletHenry Griffin (II)actor28
Special Guest AppearanceHamletAyun Hallidayactor30
Special Guest AppearanceHamletGreg Kotisactor31
Special Guest AppearanceHamletBarry Manaschactor32
Special Guest AppearanceHamletPhilip McKenneyactor33
Special Guest AppearanceHamletColin Puthactor35
Special Guest AppearanceHamletGiancarlo Romaactor37
Special Guest AppearanceHamletThomas Romaactor38
Special Guest AppearanceHamletD.J. Daraactress21
Special Guest AppearanceHamletSinead Dolanactress22
Special Guest AppearanceHamletSarah Fiolactress25
Special Guest AppearanceHamletTanya Gingerichactress26
Special Guest AppearanceHamletAnne Nixon (II)actress34
Special Guest AppearanceHamletIndia Reed Kotisactress29
1964GentlemanHamletRichard SterneactorNaN
1969First PlayerHamletRoger Liveseyactor11
1996First PlayerHamletBen Thomactor42
1948First PlayerHamletHarcourt Williamsactor5
2009BernardoHamletMatt Hurley (II)actor10
1948BernardoHamletEsmond Knightactor2
1913BernardoHamletG. Richards (II)actor12
1990BernardoHamletRichard Warwickactor13
1964BernardoHamletFrederick YoungactorNaN
2009LaertesHamletHayden Adamsactor7
1964LaertesHamletJohn CullumactorNaN
1921LaertesHamletAnton De Verdieractor7
..................
1948Lady of the CourtHamletPatricia Davidson (II)actressNaN
1964Fortinbras's CaptainHamletDillon EvansactorNaN
1996Fortinbras's CaptainHamletJeffery Kissoonactor27
Fortinbras's CaptainHamletJohn Spencer-Churchillactor32
2015PoloniaHamletGillian Bevanactress4
1969Court LadyHamletAnjelica Hustonactress18
1996Sailor OneHamletDavid Yipactor47
Young HamletHamletThomas Szekeresactor41
1990Palace NoblemanHamletBarrie HollandactorNaN
1964Player PrologueHamletJohn HetheringtonactorNaN
1973Claudius, King of DenmarkHamletDan HennesseyactorNaN
1948Spear CarrierHamletChristopher LeeactorNaN
1996Elsinore CourtierHamletAnthony MaddalenaactorNaN
2000Claudius' BodyguardHamletJohn Wills Martinactor18
1948Laertes - His SonHamletTerence Morgan (II)actor16
1996Old NorwayHamletJohn Millsactor33
Sailor TwoHamletJimi Mistryactor34
1948Voice of GhostHamletLaurence Olivieractor13
1913RosencrantsHamletMontagu Rutherfordactor8
1969Court ladyHamletJennifer Tudoractress23
1948Claudius - The KingHamletBasil Sydneyactor11
Horatio - His FriendHamletNorman Woolandactor14
1996HecubaHamletJudi Denchactress12
1921Königin GertrudeHamletMathilde Brandtactress3
1996Attendant to GertrudeHamletAngela Douglasactress16
Attendant to GertrudeHamletRowena Kingactress26
Attendant to GertrudeHamletSarah Lamactress28
1948Gertrude - The QueenHamletEileen Herlieactress12
1973Gertrude, Queen of DenmarkHamletBecke KelleractressNaN
1948Ophelia - and DaughterHamletJean Simmonsactress17
\n", + "

299 rows × 4 columns

\n", + "
" + ], + "text/plain": [ + " title name type n\n", + "year character \n", + "1964 Lady Hamlet Kate Beswick actress NaN\n", + " Lady Hamlet Carol Teitel actress NaN\n", + "2000 Special Guest Appearance Hamlet Paul Ferriter actor 23\n", + " Special Guest Appearance Hamlet Paul Graham (IV) actor 27\n", + " Special Guest Appearance Hamlet Henry Griffin (II) actor 28\n", + " Special Guest Appearance Hamlet Ayun Halliday actor 30\n", + " Special Guest Appearance Hamlet Greg Kotis actor 31\n", + " Special Guest Appearance Hamlet Barry Manasch actor 32\n", + " Special Guest Appearance Hamlet Philip McKenney actor 33\n", + " Special Guest Appearance Hamlet Colin Puth actor 35\n", + " Special Guest Appearance Hamlet Giancarlo Roma actor 37\n", + " Special Guest Appearance Hamlet Thomas Roma actor 38\n", + " Special Guest Appearance Hamlet D.J. Dara actress 21\n", + " Special Guest Appearance Hamlet Sinead Dolan actress 22\n", + " Special Guest Appearance Hamlet Sarah Fiol actress 25\n", + " Special Guest Appearance Hamlet Tanya Gingerich actress 26\n", + " Special Guest Appearance Hamlet Anne Nixon (II) actress 34\n", + " Special Guest Appearance Hamlet India Reed Kotis actress 29\n", + "1964 Gentleman Hamlet Richard Sterne actor NaN\n", + "1969 First Player Hamlet Roger Livesey actor 11\n", + "1996 First Player Hamlet Ben Thom actor 42\n", + "1948 First Player Hamlet Harcourt Williams actor 5\n", + "2009 Bernardo Hamlet Matt Hurley (II) actor 10\n", + "1948 Bernardo Hamlet Esmond Knight actor 2\n", + "1913 Bernardo Hamlet G. Richards (II) actor 12\n", + "1990 Bernardo Hamlet Richard Warwick actor 13\n", + "1964 Bernardo Hamlet Frederick Young actor NaN\n", + "2009 Laertes Hamlet Hayden Adams actor 7\n", + "1964 Laertes Hamlet John Cullum actor NaN\n", + "1921 Laertes Hamlet Anton De Verdier actor 7\n", + "... ... ... ... ..\n", + "1948 Lady of the Court Hamlet Patricia Davidson (II) actress NaN\n", + "1964 Fortinbras's Captain Hamlet Dillon Evans actor NaN\n", + "1996 Fortinbras's Captain Hamlet Jeffery Kissoon actor 27\n", + " Fortinbras's Captain Hamlet John Spencer-Churchill actor 32\n", + "2015 Polonia Hamlet Gillian Bevan actress 4\n", + "1969 Court Lady Hamlet Anjelica Huston actress 18\n", + "1996 Sailor One Hamlet David Yip actor 47\n", + " Young Hamlet Hamlet Thomas Szekeres actor 41\n", + "1990 Palace Nobleman Hamlet Barrie Holland actor NaN\n", + "1964 Player Prologue Hamlet John Hetherington actor NaN\n", + "1973 Claudius, King of Denmark Hamlet Dan Hennessey actor NaN\n", + "1948 Spear Carrier Hamlet Christopher Lee actor NaN\n", + "1996 Elsinore Courtier Hamlet Anthony Maddalena actor NaN\n", + "2000 Claudius' Bodyguard Hamlet John Wills Martin actor 18\n", + "1948 Laertes - His Son Hamlet Terence Morgan (II) actor 16\n", + "1996 Old Norway Hamlet John Mills actor 33\n", + " Sailor Two Hamlet Jimi Mistry actor 34\n", + "1948 Voice of Ghost Hamlet Laurence Olivier actor 13\n", + "1913 Rosencrants Hamlet Montagu Rutherford actor 8\n", + "1969 Court lady Hamlet Jennifer Tudor actress 23\n", + "1948 Claudius - The King Hamlet Basil Sydney actor 11\n", + " Horatio - His Friend Hamlet Norman Wooland actor 14\n", + "1996 Hecuba Hamlet Judi Dench actress 12\n", + "1921 Königin Gertrude Hamlet Mathilde Brandt actress 3\n", + "1996 Attendant to Gertrude Hamlet Angela Douglas actress 16\n", + " Attendant to Gertrude Hamlet Rowena King actress 26\n", + " Attendant to Gertrude Hamlet Sarah Lam actress 28\n", + "1948 Gertrude - The Queen Hamlet Eileen Herlie actress 12\n", + "1973 Gertrude, Queen of Denmark Hamlet Becke Keller actress NaN\n", + "1948 Ophelia - and Daughter Hamlet Jean Simmons actress 17\n", + "\n", + "[299 rows x 4 columns]" + ] + }, + "execution_count": 246, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "c = cast\n", + "c = c[c.title == 'Hamlet']\n", + "c = c.set_index(['year', 'character'])#.unstack('type')\n", + "c" + ] + }, + { + "cell_type": "code", + "execution_count": 239, + "metadata": { + "collapsed": false + }, + "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", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
titlenamecharactern
yeartype
1964actressHamletKate BeswickLadyNaN
actressHamletCarol TeitelLadyNaN
2000actorHamletPaul FerriterSpecial Guest Appearance23
actorHamletPaul Graham (IV)Special Guest Appearance27
actorHamletHenry Griffin (II)Special Guest Appearance28
actorHamletAyun HallidaySpecial Guest Appearance30
actorHamletGreg KotisSpecial Guest Appearance31
actorHamletBarry ManaschSpecial Guest Appearance32
actorHamletPhilip McKenneySpecial Guest Appearance33
actorHamletColin PuthSpecial Guest Appearance35
actorHamletGiancarlo RomaSpecial Guest Appearance37
actorHamletThomas RomaSpecial Guest Appearance38
actressHamletD.J. DaraSpecial Guest Appearance21
actressHamletSinead DolanSpecial Guest Appearance22
actressHamletSarah FiolSpecial Guest Appearance25
actressHamletTanya GingerichSpecial Guest Appearance26
actressHamletAnne Nixon (II)Special Guest Appearance34
actressHamletIndia Reed KotisSpecial Guest Appearance29
1964actorHamletRichard SterneGentlemanNaN
1969actorHamletRoger LiveseyFirst Player11
1996actorHamletBen ThomFirst Player42
1948actorHamletHarcourt WilliamsFirst Player5
2009actorHamletMatt Hurley (II)Bernardo10
1948actorHamletEsmond KnightBernardo2
1913actorHamletG. Richards (II)Bernardo12
1990actorHamletRichard WarwickBernardo13
1964actorHamletFrederick YoungBernardoNaN
2009actorHamletHayden AdamsLaertes7
1964actorHamletJohn CullumLaertesNaN
1921actorHamletAnton De VerdierLaertes7
..................
1948actressHamletPatricia Davidson (II)Lady of the CourtNaN
1964actorHamletDillon EvansFortinbras's CaptainNaN
1996actorHamletJeffery KissoonFortinbras's Captain27
actorHamletJohn Spencer-ChurchillFortinbras's Captain32
2015actressHamletGillian BevanPolonia4
1969actressHamletAnjelica HustonCourt Lady18
1996actorHamletDavid YipSailor One47
actorHamletThomas SzekeresYoung Hamlet41
1990actorHamletBarrie HollandPalace NoblemanNaN
1964actorHamletJohn HetheringtonPlayer PrologueNaN
1973actorHamletDan HennesseyClaudius, King of DenmarkNaN
1948actorHamletChristopher LeeSpear CarrierNaN
1996actorHamletAnthony MaddalenaElsinore CourtierNaN
2000actorHamletJohn Wills MartinClaudius' Bodyguard18
1948actorHamletTerence Morgan (II)Laertes - His Son16
1996actorHamletJohn MillsOld Norway33
actorHamletJimi MistrySailor Two34
1948actorHamletLaurence OlivierVoice of Ghost13
1913actorHamletMontagu RutherfordRosencrants8
1969actressHamletJennifer TudorCourt lady23
1948actorHamletBasil SydneyClaudius - The King11
actorHamletNorman WoolandHoratio - His Friend14
1996actressHamletJudi DenchHecuba12
1921actressHamletMathilde BrandtKönigin Gertrude3
1996actressHamletAngela DouglasAttendant to Gertrude16
actressHamletRowena KingAttendant to Gertrude26
actressHamletSarah LamAttendant to Gertrude28
1948actressHamletEileen HerlieGertrude - The Queen12
1973actressHamletBecke KellerGertrude, Queen of DenmarkNaN
1948actressHamletJean SimmonsOphelia - and Daughter17
\n", + "

299 rows × 4 columns

\n", + "
" + ], + "text/plain": [ + " title name character n\n", + "year type \n", + "1964 actress Hamlet Kate Beswick Lady NaN\n", + " actress Hamlet Carol Teitel Lady NaN\n", + "2000 actor Hamlet Paul Ferriter Special Guest Appearance 23\n", + " actor Hamlet Paul Graham (IV) Special Guest Appearance 27\n", + " actor Hamlet Henry Griffin (II) Special Guest Appearance 28\n", + " actor Hamlet Ayun Halliday Special Guest Appearance 30\n", + " actor Hamlet Greg Kotis Special Guest Appearance 31\n", + " actor Hamlet Barry Manasch Special Guest Appearance 32\n", + " actor Hamlet Philip McKenney Special Guest Appearance 33\n", + " actor Hamlet Colin Puth Special Guest Appearance 35\n", + " actor Hamlet Giancarlo Roma Special Guest Appearance 37\n", + " actor Hamlet Thomas Roma Special Guest Appearance 38\n", + " actress Hamlet D.J. Dara Special Guest Appearance 21\n", + " actress Hamlet Sinead Dolan Special Guest Appearance 22\n", + " actress Hamlet Sarah Fiol Special Guest Appearance 25\n", + " actress Hamlet Tanya Gingerich Special Guest Appearance 26\n", + " actress Hamlet Anne Nixon (II) Special Guest Appearance 34\n", + " actress Hamlet India Reed Kotis Special Guest Appearance 29\n", + "1964 actor Hamlet Richard Sterne Gentleman NaN\n", + "1969 actor Hamlet Roger Livesey First Player 11\n", + "1996 actor Hamlet Ben Thom First Player 42\n", + "1948 actor Hamlet Harcourt Williams First Player 5\n", + "2009 actor Hamlet Matt Hurley (II) Bernardo 10\n", + "1948 actor Hamlet Esmond Knight Bernardo 2\n", + "1913 actor Hamlet G. Richards (II) Bernardo 12\n", + "1990 actor Hamlet Richard Warwick Bernardo 13\n", + "1964 actor Hamlet Frederick Young Bernardo NaN\n", + "2009 actor Hamlet Hayden Adams Laertes 7\n", + "1964 actor Hamlet John Cullum Laertes NaN\n", + "1921 actor Hamlet Anton De Verdier Laertes 7\n", + "... ... ... ... ..\n", + "1948 actress Hamlet Patricia Davidson (II) Lady of the Court NaN\n", + "1964 actor Hamlet Dillon Evans Fortinbras's Captain NaN\n", + "1996 actor Hamlet Jeffery Kissoon Fortinbras's Captain 27\n", + " actor Hamlet John Spencer-Churchill Fortinbras's Captain 32\n", + "2015 actress Hamlet Gillian Bevan Polonia 4\n", + "1969 actress Hamlet Anjelica Huston Court Lady 18\n", + "1996 actor Hamlet David Yip Sailor One 47\n", + " actor Hamlet Thomas Szekeres Young Hamlet 41\n", + "1990 actor Hamlet Barrie Holland Palace Nobleman NaN\n", + "1964 actor Hamlet John Hetherington Player Prologue NaN\n", + "1973 actor Hamlet Dan Hennessey Claudius, King of Denmark NaN\n", + "1948 actor Hamlet Christopher Lee Spear Carrier NaN\n", + "1996 actor Hamlet Anthony Maddalena Elsinore Courtier NaN\n", + "2000 actor Hamlet John Wills Martin Claudius' Bodyguard 18\n", + "1948 actor Hamlet Terence Morgan (II) Laertes - His Son 16\n", + "1996 actor Hamlet John Mills Old Norway 33\n", + " actor Hamlet Jimi Mistry Sailor Two 34\n", + "1948 actor Hamlet Laurence Olivier Voice of Ghost 13\n", + "1913 actor Hamlet Montagu Rutherford Rosencrants 8\n", + "1969 actress Hamlet Jennifer Tudor Court lady 23\n", + "1948 actor Hamlet Basil Sydney Claudius - The King 11\n", + " actor Hamlet Norman Wooland Horatio - His Friend 14\n", + "1996 actress Hamlet Judi Dench Hecuba 12\n", + "1921 actress Hamlet Mathilde Brandt Königin Gertrude 3\n", + "1996 actress Hamlet Angela Douglas Attendant to Gertrude 16\n", + " actress Hamlet Rowena King Attendant to Gertrude 26\n", + " actress Hamlet Sarah Lam Attendant to Gertrude 28\n", + "1948 actress Hamlet Eileen Herlie Gertrude - The Queen 12\n", + "1973 actress Hamlet Becke Keller Gertrude, Queen of Denmark NaN\n", + "1948 actress Hamlet Jean Simmons Ophelia - and Daughter 17\n", + "\n", + "[299 rows x 4 columns]" + ] + }, + "execution_count": 239, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "c = cast\n", + "c = c[c.title == 'Hamlet']\n", + "c = c.set_index(['year', 'type'])#.unstack('type')\n", + "c" + ] }, { "cell_type": "code", diff --git a/Solutions-1.ipynb b/Solutions-1.ipynb index ee8586e..b5bbbc6 100644 --- a/Solutions-1.ipynb +++ b/Solutions-1.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 4, + "execution_count": 1, "metadata": { "collapsed": false }, @@ -15,7 +15,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 2, "metadata": { "collapsed": false }, @@ -64,7 +64,7 @@ "" ] }, - "execution_count": 5, + "execution_count": 2, "metadata": {}, "output_type": "execute_result" } @@ -77,7 +77,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 3, "metadata": { "collapsed": false }, @@ -97,80 +97,55 @@ " \n", " \n", " 0\n", - " 3orthographies\n", - " 2013\n", + " A Lélek órása\n", + " 1923\n", " \n", " \n", " 1\n", - " 11 Minutes (I)\n", - " 2014\n", + " Aizaugusa gravi viegli krist\n", + " 1986\n", " \n", " \n", " 2\n", - " A Lélek órása\n", - " 1923\n", + " Agliyorum\n", + " 1988\n", " \n", " \n", " 3\n", - " A Gypsy Girl's Love\n", - " 1908\n", + " 0_1_0\n", + " 2008\n", " \n", " \n", " 4\n", - " A Woman Scorned\n", - " 1999\n", + " 97 fung lau mung\n", + " 1994\n", " \n", " \n", "\n", "" ], "text/plain": [ - " title year\n", - "0 3orthographies 2013\n", - "1 11 Minutes (I) 2014\n", - "2 A Lélek órása 1923\n", - "3 A Gypsy Girl's Love 1908\n", - "4 A Woman Scorned 1999" + " title year\n", + "0 A Lélek órása 1923\n", + "1 Aizaugusa gravi viegli krist 1986\n", + "2 Agliyorum 1988\n", + "3 0_1_0 2008\n", + "4 97 fung lau mung 1994" ] }, - "execution_count": 6, + "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "titles = pd.DataFrame.from_csv('titles.csv', index_col=None)\n", + "titles = pd.DataFrame.from_csv('data/titles.csv', index_col=None)\n", "titles.head()" ] }, { "cell_type": "code", - "execution_count": 7, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\n", - "Int64Index: 808880 entries, 0 to 808879\n", - "Data columns (total 2 columns):\n", - "title 808880 non-null object\n", - "year 808880 non-null float64\n", - "dtypes: float64(1), object(1)\n", - "memory usage: 18.5+ MB\n" - ] - } - ], - "source": [ - "titles.info()" - ] - }, - { - "cell_type": "code", - "execution_count": 8, + "execution_count": 4, "metadata": { "collapsed": false }, @@ -184,6 +159,7 @@ " \n", " \n", " title\n", + " year\n", " name\n", " type\n", " character\n", @@ -193,96 +169,503 @@ " \n", " \n", " 0\n", - " The Core\n", - " Alejandro Abellan\n", - " actor\n", - " U.S.S. Soldier\n", + " The Core\n", + " 2003\n", + " Alejandro Abellan\n", + " actor\n", + " U.S.S. Soldier\n", " NaN\n", " \n", " \n", " 1\n", - " Il momento di uccidere\n", - " Remo De Angelis\n", - " actor\n", - " Dago\n", - " 9\n", + " Il momento di uccidere\n", + " 1968\n", + " Remo De Angelis\n", + " actor\n", + " Dago\n", + " 9\n", " \n", " \n", " 2\n", - " Across the Divide\n", - " Thomas Delmar\n", - " actor\n", - " Dago\n", - " 4\n", + " Across the Divide\n", + " 1921\n", + " Thomas Delmar\n", + " actor\n", + " Dago\n", + " 4\n", " \n", " \n", " 3\n", - " Revan\n", - " Diego James\n", - " actor\n", - " Dago\n", + " Revan\n", + " 2012\n", + " Diego James\n", + " actor\n", + " Dago\n", " NaN\n", " \n", " \n", " 4\n", - " Un homme marche dans la ville\n", - " Fabien Loris\n", - " actor\n", - " Dago\n", - " 12\n", + " Un homme marche dans la ville\n", + " 1950\n", + " Fabien Loris\n", + " actor\n", + " Dago\n", + " 12\n", " \n", " \n", "\n", "" ], "text/plain": [ - " title name type character n\n", - "0 The Core Alejandro Abellan actor U.S.S. Soldier NaN\n", - "1 Il momento di uccidere Remo De Angelis actor Dago 9\n", - "2 Across the Divide Thomas Delmar actor Dago 4\n", - "3 Revan Diego James actor Dago NaN\n", - "4 Un homme marche dans la ville Fabien Loris actor Dago 12" + " title year name type \\\n", + "0 The Core 2003 Alejandro Abellan actor \n", + "1 Il momento di uccidere 1968 Remo De Angelis actor \n", + "2 Across the Divide 1921 Thomas Delmar actor \n", + "3 Revan 2012 Diego James actor \n", + "4 Un homme marche dans la ville 1950 Fabien Loris actor \n", + "\n", + " character n \n", + "0 U.S.S. Soldier NaN \n", + "1 Dago 9 \n", + "2 Dago 4 \n", + "3 Dago NaN \n", + "4 Dago 12 " ] }, - "execution_count": 8, + "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "cast = pd.DataFrame.from_csv('cast.csv', index_col=None)\n", + "cast = pd.DataFrame.from_csv('data/cast.csv', index_col=None)\n", "cast.head()" ] }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 5, "metadata": { "collapsed": false }, "outputs": [ { - "name": "stdout", - "output_type": "stream", - "text": [ - "\n", - "Int64Index: 5271490 entries, 0 to 5271489\n", - "Data columns (total 5 columns):\n", - "title object\n", - "name object\n", - "type object\n", - "character object\n", - "n float64\n", - "dtypes: float64(1), object(4)\n", - "memory usage: 241.3+ MB\n" - ] + "data": { + "text/plain": [ + "306951" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# How many movies are listed in the titles dataframe?\n", + "\n", + "len(titles)" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "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", + "
titleyear
172161Miss Jerry1894
207934Reproduction of the Corbett and Fitzsimmons Fight1897
\n", + "
" + ], + "text/plain": [ + " title year\n", + "172161 Miss Jerry 1894\n", + "207934 Reproduction of the Corbett and Fitzsimmons Fight 1897" + ] + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# What are the earliest two films listed in the titles dataframe?\n", + "\n", + "titles.sort('year').head(2)" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "20" + ] + }, + "execution_count": 18, + "metadata": {}, + "output_type": "execute_result" } ], "source": [ - "cast.info()" + "# How many movies have the title \"Hamlet\"?\n", + "\n", + "len(titles[titles.title == 'Hamlet'])" ] }, { + "cell_type": "code", + "execution_count": 27, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "1" + ] + }, + "execution_count": 27, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# How many movies are titled \"North by Northwest\"?\n", + "\n", + "len(titles[titles.title == 'North by Northwest'])" + ] + }, + { + "cell_type": "code", + "execution_count": 61, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
titleyear
104882Hamlet1910
\n", + "
" + ], + "text/plain": [ + " title year\n", + "104882 Hamlet 1910" + ] + }, + "execution_count": 61, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# When was the first movie named \"Hamlet\" made?\n", + "\n", + "titles[titles.title == 'Hamlet'].sort('year').head(1)" + ] + }, + { + "cell_type": "code", + "execution_count": 49, + "metadata": { + "collapsed": false + }, + "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", + "
titleyear
285800Treasure Island1918
277236Treasure Island1920
286174Treasure Island1934
287490Treasure Island1950
285791Treasure Island1972
290784Treasure Island1973
285646Treasure Island1985
279936Treasure Island1999
306813Treasure Island2001
\n", + "
" + ], + "text/plain": [ + " title year\n", + "285800 Treasure Island 1918\n", + "277236 Treasure Island 1920\n", + "286174 Treasure Island 1934\n", + "287490 Treasure Island 1950\n", + "285791 Treasure Island 1972\n", + "290784 Treasure Island 1973\n", + "285646 Treasure Island 1985\n", + "279936 Treasure Island 1999\n", + "306813 Treasure Island 2001" + ] + }, + "execution_count": 49, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# List all of the \"Treasure Island\" movies from earliest to most recent.\n", + "\n", + "titles[titles.title == 'Treasure Island'].sort('year')" + ] + }, + { + "cell_type": "code", + "execution_count": 53, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "1691" + ] + }, + "execution_count": 53, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# How many movies were made in the year 1950?\n", + "\n", + "len(titles[titles.year == 1950])" + ] + }, + { + "cell_type": "code", + "execution_count": 54, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "2298" + ] + }, + "execution_count": 54, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# How many movies were made in the year 1960?\n", + "\n", + "len(titles[titles.year == 1960])" + ] + }, + { + "cell_type": "code", + "execution_count": 58, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "19674" + ] + }, + "execution_count": 58, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# How many movies were made from 1950 through 1959?\n", + "\n", + "t = titles\n", + "len(t[(t.year >= 1950) & (t.year <= 1959)])" + ] + }, + { + "cell_type": "code", + "execution_count": 59, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "19674" + ] + }, + "execution_count": 59, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "len(t[t.year // 10 == 195])" + ] + }, + { + "cell_type": "code", + "execution_count": 69, + "metadata": { + "collapsed": false + }, + "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", + "
titleyear
24368Batman1989
28556Batman1943
305635Batman1966
\n", + "
" + ], + "text/plain": [ + " title year\n", + "24368 Batman 1989\n", + "28556 Batman 1943\n", + "305635 Batman 1966" + ] + }, + "execution_count": 69, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# In what years has a movie titled \"Batman\" been released?\n", + "\n", + "t = titles\n", + "t[t.title == 'Batman']" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + }, + { "cell_type": "markdown", "metadata": {}, "source": [ diff --git a/script.txt b/script.txt index b7dbfca..41b563d 100644 --- a/script.txt +++ b/script.txt @@ -14,7 +14,7 @@ titles.tail() and .tail(10) Filtering h['year'] or h.year -h.year.size does this even +h.year.size does this even no h.year + 1000 h.year - 2000 @@ -50,7 +50,7 @@ h.value_counts() (While doing exercises:) -true_false.sum() +true_false.sum() ? cast.columns ? diff --git a/slides.txt b/slides.txt index 9838b50..22b4074 100644 --- a/slides.txt +++ b/slides.txt @@ -1,12 +1,12 @@ - len(df) df.head() df.tail() df.column + value - df['column'] -or- df.column df.column + df.another_column - - df[df.c == value] + - * / // % - df[(df.c > value) & (df.d < value)] == < > >= <= != - df[(df.c < value) | (df.d > value)] + len(df) df.head() df.tail() df.column.notnull() + df['column'] -or- df.column df.column + value + df.column + df.another_column + df[df.c == value] + df[(df.c > value) & (df.d < value)] Mathematics + - * / // % + df[(df.c < value) | (df.d > value)] Comparisons == != < > >= <= df.sort(['column']) df.column.str.contains(s) df.sort(['column1', 'column2']) df.column.str.endswith(s)