{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Probability and an Introduction to Jupyter, Python and Pandas\n", "\n", "## Data Science School, Nyeri, Kenya\n", "\n", "### 15th June 2015 Neil Lawrence" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Welcome to the Data Science School in Nyeri, Kenya. In this school we will introduce the basic concepts of machine learning and data science. In particular we will look at tools and techniques that describe how to model. An integrated part of that is how we approach data with the computer. We are choosing to do that with the tool you see in front of you: the Jupyter Notebook. \n", "\n", "The notebook provides us with a way of interacting with the data that allows us to give the computer instructions and explore the nature of a data set. It is *different* to normal coding, but it is related. In this course you will, through intensive practical sessions and labs, develop your understanding of the interaction between data and computers. \n", "\n", "The first thing we are going to do is ask you to forget a bit about what you think about normal programming, or 'classical software engineering'. Classical software engineering demands a large amount of design and testing. In data analysis, testing remains very important, but the design is often evolving. The design evolves through a process known as *exploratory data analysis*. You will learn some of the techniques of exploratory data analysis in this course.\n", "\n", "A particular difference between classical software engineering and data analysis is the way in which programs are run. Classically we spend a deal of time working with a text editor, writing code. Compilations are done on a regular basis and aspects of the code are tested (perhaps with unit tests). \n", "\n", "Data analysis is more like coding in a debugger. In a debugger (particularly a visual debugger) you interact with the data stored in the memory of the computer to try and understand what is happening in the computer, you need to understand exactly what your bug is: you often have a fixed idea of what the program is trying to do, you are just struggling to find out why it isn't doing it. \n", "\n", "Naturally, debugging is an important part of data analysis also, but in some sense it can be seen as its entire premise. You load in a data set into a computer that you don't understand, your entire objective is to understand the data. This is best done by interrogating the data to visualise it or summarize it, just like in a power visual debugger. However, for data science the requirements for visualization and summarization are far greater than in a regular program. When the data is well understood, the actual number of lines of your program may well be very few (particularly if you disregard commands that load in the data and commands which plot your results). If a powerful data science library is available, you may be able to summarize your code with just two or three lines, but the amount of intellectual energy that is expended on writing those three lines is far greater than in standard code.\n", "\n", "In the first lecture we will think a little about 'how we got here' in terms of computer science. In the lecture itself, this will be done by taking a subjective perspective, that of my own 'data autobiography'." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Assumed Knowledge\n", "\n", "### Linear Algebra, Probability and Differential Calculus\n", "\n", "We will be assuming that you have good background in maths. In particular we will be making use of linear algebra (matrix operations including inverse, inner products, determinant etc), probability (sum rule of probability, product rule of probability), and the calculus of differentiation (and integration!). A new concept for the course is multivariate differentiation and integration. This combines linear algebra and differential calculus. These techniques are vital in understanding probability distributions over high dimensional distributions. \n", "\n", "### Choice of Language\n", "\n", "In this course we will be using Python for our programming language. A prerequisite of attending this course is that you have learnt at least one programming language in the past. It is not our objective to teach you python. At Level 4 and Masters we expect our students to be able pick up a language as they go. If you have not experienced python before it may be worth your while spending some time understanding the language. There are resources available for you to do this [here](https://docs.python.org/2/tutorial/) that are based on the standard console. An introduction to the Jupyter notebook (formerly known as the IPython notebook) is available [here](http://ipython.org/ipython-doc/2/notebook/index.html). " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Choice of Environment\n", "\n", "We are working in the Jupyter notebook (formerly known as the IPython notebook). It provides an environment for interacting with data in a natural way which is reproducible. We will be learning how to make use of the notebook throughout the course. The notebook allows us to combine code with descriptions, interactive visualizations, plots etc. In fact it allows us to do many of the things we need for data science. Notebooks can also be easily shared through the internet for ease of communication of ideas. The box this text is written in is a *markdown* box. Below we have a *code* box." ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "This is the Jupyter notebook\n", "It provides a platform for:\n", "Data Open Science\n", "Science Open Data\n", "Science Open Data\n" ] } ], "source": [ "print \"This is the Jupyter notebook\"\n", "print \"It provides a platform for:\"\n", "words = ['Open', 'Data', 'Science']\n", "from random import shuffle\n", "for i in range(3):\n", " shuffle(words)\n", " print ' '.join(words)\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Have a play with the code in the above box. Think about the following questions: what is the difference between `CTRL-enter` and `SHIFT-enter` in running the code? What does the command `shuffle` do? Can you find out by typing `shuffle?` in a code box?\n", "Once you've had a play with the code we can load in some data using the `pandas` library for data analysis. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Movie Body Count Example\n", "\n", "There is a crisis in the movie industry, deaths are occurring on a massive scale. In every feature film the body count is tolling up. But what is the cause of all these deaths? Let's try and investigate.\n", "\n", "For our first example of data science, we take inspiration from work by [researchers at NJIT](http://www.theswarmlab.com/r-vs-python-round-2/). They researchers were comparing the qualities of Python with R (my brief thoughts on the subject are available in a Google+ post here: https://plus.google.com/116220678599902155344/posts/5iKyqcrNN68). They put together a data base of results from the the \"Internet Movie Database\" and the [Movie Body Count](http://www.moviebodycounts.com/) website which will allow us to do some preliminary investigation." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We will make use of data that has already been 'scraped' from the [Movie Body Count](http://www.moviebodycounts.com/) website. Code and the data is available at [a github repository](https://github.com/sjmgarnier/R-vs-Python/tree/master/Deadliest%20movies%20scrape/code). Git is a version control system and github is a website that hosts code that can be accessed through git. By sharing the code publicly through github, the authors are licensing the code publicly and allowing you to access and edit it. As well as accessing the code via github you can also [download the zip file](https://github.com/sjmgarnier/R-vs-Python/archive/master.zip). But let's do that in python" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": false }, "outputs": [ { "ename": "ImportError", "evalue": "No module named tffutfjytfvjtuyfgkutc", "output_type": "error", "traceback": [ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[0;31mImportError\u001b[0m Traceback (most recent call last)", "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0;32mimport\u001b[0m \u001b[0mtffutfjytfvjtuyfgkutc\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mpandas\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0mpd\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0mdata\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mpods\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdatasets\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmovie_body_count\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0mfilm_deaths\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdata\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'Y'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;31mImportError\u001b[0m: No module named tffutfjytfvjtuyfgkutc" ] } ], "source": [ "import pods\n", "import pandas as pd\n", "data = pods.datasets.movie_body_count()\n", "film_deaths = data['Y']" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Once the data is downloaded we can unzip it into the same directory where we are running the lab class. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Once it is loaded in the data can be summarized using the `describe` method in pandas.\n" ] }, { "cell_type": "code", "execution_count": 2, "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", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
FilmYearBody_CountMPAA_RatingGenreDirectorActorsLength_MinutesIMDB_Rating
0 24 Hour Party People 2002 7 R Biography|Comedy|Drama|Music Michael Winterbottom Steve Coogan|John Thomson|Paul Popplewell|Lenn... 117 7.4
1 3:10 to Yuma 2007 45 R Adventure|Crime|Drama|Western James Mangold Russell Crowe|Christian Bale|Logan Lerman|Dall... 122 7.8
2 300 2006 0 R Action|Fantasy|History|War Zack Snyder Gerard Butler|Lena Headey|Dominic West|David W... 117 7.8
3 8MM 1999 7 R Crime|Mystery|Thriller Joel Schumacher Nicolas Cage|Joaquin Phoenix|James Gandolfini|... 123 6.4
4 The Abominable Dr. Phibes 1971 10 PG-13 Fantasy|Horror Robert Fuest Vincent Price|Joseph Cotten|Hugh Griffith|Terr... 94 7.2
5 Above the Law 1988 18 NaN Action|Crime|Drama|Thriller Andrew Davis Steven Seagal|Pam Grier|Henry Silva|Ron Dean|D... 99 5.9
6 Action Jackson 1988 17 NaN Action|Comedy|Crime|Thriller Craig R. Baxley Carl Weathers|Craig T. Nelson|Vanity|Sharon St... 96 5.0
7 The Adventures of Ford Fairlane 1990 7 NaN Action|Adventure|Comedy|Music Renny Harlin Andrew Dice Clay|Wayne Newton|Priscilla Presle... 104 6.2
8 ?on Flux 2005 58 PG-13 Action|Sci-Fi Karyn Kusama Charlize Theron|Marton Csokas|Jonny Lee Miller... 93 5.5
9 Akira 1988 119 R Animation|Action|Adventure|Drama|Horror|Myster... Katsuhiro Ohtomo Mitsuo Iwata|Nozomu Sasaki|Mami Koyama|Tesshô ... 124 8.1
10 Ali G Indahouse 2002 11 R Comedy Mark Mylod Sacha Baron Cohen|Emilio Rivera|Gina La Piana|... 85 6.2
11 Alien 1979 9 R Horror|Sci-Fi Ridley Scott Tom Skerritt|Sigourney Weaver|Veronica Cartwri... 117 8.5
12 AVPR: Aliens vs Predator - Requiem 2007 115 R Action|Horror|Sci-Fi|Thriller Colin Strause|Greg Strause Steven Pasquale|Reiko Aylesworth|John Ortiz|Jo... 94 4.7
13 Alpha Dog 2006 3 R Biography|Crime|Drama Nick Cassavetes Bruce Willis|Matthew Barry|Emile Hirsch|Fernan... 122 6.9
14 Altered States 1980 5 NaN Drama|Fantasy|Horror|Sci-Fi|Thriller Ken Russell William Hurt|Blair Brown|Bob Balaban|Charles H... 102 6.9
15 American Gangster 2007 15 R Biography|Crime|Drama Ridley Scott Denzel Washington|Russell Crowe|Chiwetel Ejiof... 157 7.8
16 American Ninja 1985 114 NaN Action|Adventure|Romance|Sport Sam Firstenberg Michael Dudikoff|Steve James|Judie Aronson|Gui... 95 5.2
17 American Pop 1981 61 NaN Animation|Drama|Music Ralph Bakshi Ron Thompson|Mews Small|Jerry Holland|Lisa Jan... 96 7.1
18 American Psycho 2000 18 R Crime|Drama Mary Harron Christian Bale|Justin Theroux|Josh Lucas|Bill ... 102 7.6
19 American Yakuza 1993 53 NaN Action|Crime|Drama|Thriller Frank A. Cappello Viggo Mortensen|Ryo Ishibashi|Michael Nouri|Fr... 96 5.7
20 Another Day in Paradise 1998 9 R Crime|Drama|Thriller Larry Clark James Woods|Melanie Griffith|Vincent Kartheise... 101 6.5
21 Apocalypse Now 1979 62 R Drama|War Francis Ford Coppola Marlon Brando|Martin Sheen|Robert Duvall|Frede... 153 8.5
22 Apocalypto 2006 114 R Action|Adventure|Drama|Thriller Mel Gibson Rudy Youngblood|Dalia Hernández|Jonathan Brewe... 139 7.8
23 Appaloosa 2008 10 R Crime|Drama|Western Ed Harris Robert Jauregui|Jeremy Irons|Timothy V. Murphy... 115 6.8
24 Armageddon 1998 16 PG-13 Action|Adventure|Sci-Fi|Thriller Michael Bay Bruce Willis|Billy Bob Thornton|Ben Affleck|Li... 151 6.6
25 Army of Darkness 1992 107 R Comedy|Fantasy|Horror Sam Raimi Bruce Campbell|Embeth Davidtz|Marcus Gilbert|I... 81 7.6
26 Assault on Precinct 13 1976 39 NaN Action|Crime|Thriller John Carpenter Austin Stoker|Darwin Joston|Laurie Zimmer|Mart... 91 7.4
27 Assault on Precinct 13 2005 21 R Action|Drama|Crime|Thriller Jean-François Richet Ethan Hawke|Laurence Fishburne|Gabriel Byrne|M... 109 6.3
28 Atonement 2007 34 R Drama|Mystery|Romance|War Joe Wright Saoirse Ronan|Ailidh Mackay|Brenda Blethyn|Jul... 123 7.8
29 Austin Powers in Goldmember 2002 6 PG-13 Action|Comedy|Crime Jay Roach Mike Myers|Beyoncé Knowles|Seth Green|Michael ... 94 6.2
..............................
391 The Usual Suspects 1995 39 R Crime|Mystery|Thriller Bryan Singer Stephen Baldwin|Gabriel Byrne|Benicio Del Toro... 106 8.7
392 V for Vendetta 2005 59 R Action|Sci-Fi|Thriller James McTeigue Natalie Portman|Hugo Weaving|Stephen Rea|Steph... 132 8.2
393 Valkyrie 2008 18 PG-13 Drama|History|Thriller|War Bryan Singer Tom Cruise|Kenneth Branagh|Bill Nighy|Tom Wilk... 121 7.1
394 Vampires: The Turning 2005 53 R Action|Horror|Thriller Marty Weiss Colin Egglesfield|Stephanie Chao|Roger Yuan|Pa... 84 3.3
395 Versus 2000 127 R Action|Fantasy|Horror Ryûhei Kitamura Tak Sakaguchi|Hideo Sakaki|Chieko Misaka|Kenji... 119 6.6
396 Videodrome 1983 8 NaN Horror|Sci-Fi David Cronenberg James Woods|Sonja Smits|Deborah Harry|Peter Dv... 87 7.3
397 A View to a Kill 1985 37 NaN Action|Adventure|Crime|Thriller John Glen Roger Moore|Christopher Walken|Tanya Roberts|G... 131 6.3
398 Waist Deep 2006 6 R Action|Crime|Drama|Thriller Vondie Curtis-Hall Tyrese Gibson|Shawn Parr|Henry Hunter Hall|Joh... 97 5.9
399 Walk Hard: The Dewey Cox Story 2007 5 R Comedy|Drama|Music Jake Kasdan Nat Faxon|John C. Reilly|Tim Meadows|Conner Ra... 96 6.7
400 Walking Tall 2004 6 PG-13 Action|Crime Kevin Bray Michael Bowen|Johnny Knoxville|Dwayne Johnson|... 86 6.2
401 War 2007 97 R Action|Crime|Thriller Philip G. Atwell Jet Li|Jason Statham|John Lone|Devon Aoki|Luis... 103 6.2
402 War Inc. 2008 73 R Action|Comedy|Thriller Joshua Seftel John Cusack|Hilary Duff|Marisa Tomei|Joan Cusa... 107 5.7
403 War of the Worlds 2005 52 PG-13 Adventure|Sci-Fi|Thriller Steven Spielberg Tom Cruise|Dakota Fanning|Miranda Otto|Justin ... 116 6.5
404 Wasabi 2001 22 R Action|Drama|Comedy|Crime|Thriller Gérard Krawczyk Jean Reno|Ryôko Hirosue|Michel Muller|Carole B... 94 6.6
405 The Way of the Gun 2000 18 R Action|Crime|Drama|Thriller Christopher McQuarrie Ryan Phillippe|Benicio Del Toro|Juliette Lewis... 119 6.7
406 We Were Soldiers 2002 305 R Action|Drama|History|War Randall Wallace Mel Gibson|Madeleine Stowe|Greg Kinnear|Sam El... 138 7.1
407 Where Eagles Dare 1968 100 NaN Action|Adventure|War Brian G. Hutton Richard Burton|Clint Eastwood|Mary Ure|Patrick... 158 7.7
408 The Wild Bunch 1969 145 NaN Western Sam Peckinpah William Holden|Ernest Borgnine|Robert Ryan|Edm... 145 8.1
409 X-Men 2000 6 PG-13 Action|Adventure|Sci-Fi Bryan Singer Hugh Jackman|Patrick Stewart|Ian McKellen|Famk... 104 7.4
410 X2 2003 26 PG-13 Action|Adventure|Sci-Fi|Thriller Bryan Singer Patrick Stewart|Hugh Jackman|Ian McKellen|Hall... 133 7.5
411 X-Men: The Last Stand 2006 57 PG-13 Action|Adventure|Sci-Fi|Thriller Brett Ratner Hugh Jackman|Halle Berry|Ian McKellen|Patrick ... 104 6.8
412 xXx 2002 75 PG-13 Action|Thriller Rob L. Cohen Vin Diesel|Asia Argento|Marton Csokas|Samuel L... 124 5.8
413 xXx: State of the Union 2005 66 PG-13 Action|Crime|Adventure|Thriller Lee Tamahori Willem Dafoe|Samuel L. Jackson|Ice Cube|Scott ... 101 4.2
414 The Yakuza 1974 31 NaN Action|Crime|Drama|Thriller Sydney Pollack Robert Mitchum|Ken Takakura|Brian Keith|Herb E... 123 7.3
415 The Yards 2000 2 R Crime|Drama|Romance|Thriller James Gray Mark Wahlberg|Joaquin Phoenix|Charlize Theron|... 115 6.4
416 You Kill Me 2007 10 R Comedy|Crime|Romance|Thriller John Dahl Ben Kingsley|Téa Leoni|Luke Wilson|Dennis Fari... 93 6.6
417 You Only Live Twice 1967 91 NaN Action|Adventure|Crime|Thriller Lewis Gilbert Sean Connery|Akiko Wakabayashi|Mie Hama|Tetsur... 117 6.9
418 Zodiac 2007 3 R Crime|Drama|Mystery|Thriller David Fincher Jake Gyllenhaal|Mark Ruffalo|Anthony Edwards|R... 157 7.7
419 Zoolander 2001 4 PG-13 Comedy Ben Stiller Ben Stiller|Owen Wilson|Christine Taylor|Will ... 89 6.6
420 Zulu 1964 140 NaN Drama|History|War Cy Endfield Stanley Baker|Jack Hawkins|Ulla Jacobsson|Jame... 138 7.8
\n", "

421 rows × 9 columns

\n", "
" ], "text/plain": [ " Film Year Body_Count MPAA_Rating \\\n", "0 24 Hour Party People 2002 7 R \n", "1 3:10 to Yuma 2007 45 R \n", "2 300 2006 0 R \n", "3 8MM 1999 7 R \n", "4 The Abominable Dr. Phibes 1971 10 PG-13 \n", "5 Above the Law 1988 18 NaN \n", "6 Action Jackson 1988 17 NaN \n", "7 The Adventures of Ford Fairlane 1990 7 NaN \n", "8 ?on Flux 2005 58 PG-13 \n", "9 Akira 1988 119 R \n", "10 Ali G Indahouse 2002 11 R \n", "11 Alien 1979 9 R \n", "12 AVPR: Aliens vs Predator - Requiem 2007 115 R \n", "13 Alpha Dog 2006 3 R \n", "14 Altered States 1980 5 NaN \n", "15 American Gangster 2007 15 R \n", "16 American Ninja 1985 114 NaN \n", "17 American Pop 1981 61 NaN \n", "18 American Psycho 2000 18 R \n", "19 American Yakuza 1993 53 NaN \n", "20 Another Day in Paradise 1998 9 R \n", "21 Apocalypse Now 1979 62 R \n", "22 Apocalypto 2006 114 R \n", "23 Appaloosa 2008 10 R \n", "24 Armageddon 1998 16 PG-13 \n", "25 Army of Darkness 1992 107 R \n", "26 Assault on Precinct 13 1976 39 NaN \n", "27 Assault on Precinct 13 2005 21 R \n", "28 Atonement 2007 34 R \n", "29 Austin Powers in Goldmember 2002 6 PG-13 \n", ".. ... ... ... ... \n", "391 The Usual Suspects 1995 39 R \n", "392 V for Vendetta 2005 59 R \n", "393 Valkyrie 2008 18 PG-13 \n", "394 Vampires: The Turning 2005 53 R \n", "395 Versus 2000 127 R \n", "396 Videodrome 1983 8 NaN \n", "397 A View to a Kill 1985 37 NaN \n", "398 Waist Deep 2006 6 R \n", "399 Walk Hard: The Dewey Cox Story 2007 5 R \n", "400 Walking Tall 2004 6 PG-13 \n", "401 War 2007 97 R \n", "402 War Inc. 2008 73 R \n", "403 War of the Worlds 2005 52 PG-13 \n", "404 Wasabi 2001 22 R \n", "405 The Way of the Gun 2000 18 R \n", "406 We Were Soldiers 2002 305 R \n", "407 Where Eagles Dare 1968 100 NaN \n", "408 The Wild Bunch 1969 145 NaN \n", "409 X-Men 2000 6 PG-13 \n", "410 X2 2003 26 PG-13 \n", "411 X-Men: The Last Stand 2006 57 PG-13 \n", "412 xXx 2002 75 PG-13 \n", "413 xXx: State of the Union 2005 66 PG-13 \n", "414 The Yakuza 1974 31 NaN \n", "415 The Yards 2000 2 R \n", "416 You Kill Me 2007 10 R \n", "417 You Only Live Twice 1967 91 NaN \n", "418 Zodiac 2007 3 R \n", "419 Zoolander 2001 4 PG-13 \n", "420 Zulu 1964 140 NaN \n", "\n", " Genre \\\n", "0 Biography|Comedy|Drama|Music \n", "1 Adventure|Crime|Drama|Western \n", "2 Action|Fantasy|History|War \n", "3 Crime|Mystery|Thriller \n", "4 Fantasy|Horror \n", "5 Action|Crime|Drama|Thriller \n", "6 Action|Comedy|Crime|Thriller \n", "7 Action|Adventure|Comedy|Music \n", "8 Action|Sci-Fi \n", "9 Animation|Action|Adventure|Drama|Horror|Myster... \n", "10 Comedy \n", "11 Horror|Sci-Fi \n", "12 Action|Horror|Sci-Fi|Thriller \n", "13 Biography|Crime|Drama \n", "14 Drama|Fantasy|Horror|Sci-Fi|Thriller \n", "15 Biography|Crime|Drama \n", "16 Action|Adventure|Romance|Sport \n", "17 Animation|Drama|Music \n", "18 Crime|Drama \n", "19 Action|Crime|Drama|Thriller \n", "20 Crime|Drama|Thriller \n", "21 Drama|War \n", "22 Action|Adventure|Drama|Thriller \n", "23 Crime|Drama|Western \n", "24 Action|Adventure|Sci-Fi|Thriller \n", "25 Comedy|Fantasy|Horror \n", "26 Action|Crime|Thriller \n", "27 Action|Drama|Crime|Thriller \n", "28 Drama|Mystery|Romance|War \n", "29 Action|Comedy|Crime \n", ".. ... \n", "391 Crime|Mystery|Thriller \n", "392 Action|Sci-Fi|Thriller \n", "393 Drama|History|Thriller|War \n", "394 Action|Horror|Thriller \n", "395 Action|Fantasy|Horror \n", "396 Horror|Sci-Fi \n", "397 Action|Adventure|Crime|Thriller \n", "398 Action|Crime|Drama|Thriller \n", "399 Comedy|Drama|Music \n", "400 Action|Crime \n", "401 Action|Crime|Thriller \n", "402 Action|Comedy|Thriller \n", "403 Adventure|Sci-Fi|Thriller \n", "404 Action|Drama|Comedy|Crime|Thriller \n", "405 Action|Crime|Drama|Thriller \n", "406 Action|Drama|History|War \n", "407 Action|Adventure|War \n", "408 Western \n", "409 Action|Adventure|Sci-Fi \n", "410 Action|Adventure|Sci-Fi|Thriller \n", "411 Action|Adventure|Sci-Fi|Thriller \n", "412 Action|Thriller \n", "413 Action|Crime|Adventure|Thriller \n", "414 Action|Crime|Drama|Thriller \n", "415 Crime|Drama|Romance|Thriller \n", "416 Comedy|Crime|Romance|Thriller \n", "417 Action|Adventure|Crime|Thriller \n", "418 Crime|Drama|Mystery|Thriller \n", "419 Comedy \n", "420 Drama|History|War \n", "\n", " Director \\\n", "0 Michael Winterbottom \n", "1 James Mangold \n", "2 Zack Snyder \n", "3 Joel Schumacher \n", "4 Robert Fuest \n", "5 Andrew Davis \n", "6 Craig R. Baxley \n", "7 Renny Harlin \n", "8 Karyn Kusama \n", "9 Katsuhiro Ohtomo \n", "10 Mark Mylod \n", "11 Ridley Scott \n", "12 Colin Strause|Greg Strause \n", "13 Nick Cassavetes \n", "14 Ken Russell \n", "15 Ridley Scott \n", "16 Sam Firstenberg \n", "17 Ralph Bakshi \n", "18 Mary Harron \n", "19 Frank A. Cappello \n", "20 Larry Clark \n", "21 Francis Ford Coppola \n", "22 Mel Gibson \n", "23 Ed Harris \n", "24 Michael Bay \n", "25 Sam Raimi \n", "26 John Carpenter \n", "27 Jean-François Richet \n", "28 Joe Wright \n", "29 Jay Roach \n", ".. ... \n", "391 Bryan Singer \n", "392 James McTeigue \n", "393 Bryan Singer \n", "394 Marty Weiss \n", "395 Ryûhei Kitamura \n", "396 David Cronenberg \n", "397 John Glen \n", "398 Vondie Curtis-Hall \n", "399 Jake Kasdan \n", "400 Kevin Bray \n", "401 Philip G. Atwell \n", "402 Joshua Seftel \n", "403 Steven Spielberg \n", "404 Gérard Krawczyk \n", "405 Christopher McQuarrie \n", "406 Randall Wallace \n", "407 Brian G. Hutton \n", "408 Sam Peckinpah \n", "409 Bryan Singer \n", "410 Bryan Singer \n", "411 Brett Ratner \n", "412 Rob L. Cohen \n", "413 Lee Tamahori \n", "414 Sydney Pollack \n", "415 James Gray \n", "416 John Dahl \n", "417 Lewis Gilbert \n", "418 David Fincher \n", "419 Ben Stiller \n", "420 Cy Endfield \n", "\n", " Actors Length_Minutes \\\n", "0 Steve Coogan|John Thomson|Paul Popplewell|Lenn... 117 \n", "1 Russell Crowe|Christian Bale|Logan Lerman|Dall... 122 \n", "2 Gerard Butler|Lena Headey|Dominic West|David W... 117 \n", "3 Nicolas Cage|Joaquin Phoenix|James Gandolfini|... 123 \n", "4 Vincent Price|Joseph Cotten|Hugh Griffith|Terr... 94 \n", "5 Steven Seagal|Pam Grier|Henry Silva|Ron Dean|D... 99 \n", "6 Carl Weathers|Craig T. Nelson|Vanity|Sharon St... 96 \n", "7 Andrew Dice Clay|Wayne Newton|Priscilla Presle... 104 \n", "8 Charlize Theron|Marton Csokas|Jonny Lee Miller... 93 \n", "9 Mitsuo Iwata|Nozomu Sasaki|Mami Koyama|Tesshô ... 124 \n", "10 Sacha Baron Cohen|Emilio Rivera|Gina La Piana|... 85 \n", "11 Tom Skerritt|Sigourney Weaver|Veronica Cartwri... 117 \n", "12 Steven Pasquale|Reiko Aylesworth|John Ortiz|Jo... 94 \n", "13 Bruce Willis|Matthew Barry|Emile Hirsch|Fernan... 122 \n", "14 William Hurt|Blair Brown|Bob Balaban|Charles H... 102 \n", "15 Denzel Washington|Russell Crowe|Chiwetel Ejiof... 157 \n", "16 Michael Dudikoff|Steve James|Judie Aronson|Gui... 95 \n", "17 Ron Thompson|Mews Small|Jerry Holland|Lisa Jan... 96 \n", "18 Christian Bale|Justin Theroux|Josh Lucas|Bill ... 102 \n", "19 Viggo Mortensen|Ryo Ishibashi|Michael Nouri|Fr... 96 \n", "20 James Woods|Melanie Griffith|Vincent Kartheise... 101 \n", "21 Marlon Brando|Martin Sheen|Robert Duvall|Frede... 153 \n", "22 Rudy Youngblood|Dalia Hernández|Jonathan Brewe... 139 \n", "23 Robert Jauregui|Jeremy Irons|Timothy V. Murphy... 115 \n", "24 Bruce Willis|Billy Bob Thornton|Ben Affleck|Li... 151 \n", "25 Bruce Campbell|Embeth Davidtz|Marcus Gilbert|I... 81 \n", "26 Austin Stoker|Darwin Joston|Laurie Zimmer|Mart... 91 \n", "27 Ethan Hawke|Laurence Fishburne|Gabriel Byrne|M... 109 \n", "28 Saoirse Ronan|Ailidh Mackay|Brenda Blethyn|Jul... 123 \n", "29 Mike Myers|Beyoncé Knowles|Seth Green|Michael ... 94 \n", ".. ... ... \n", "391 Stephen Baldwin|Gabriel Byrne|Benicio Del Toro... 106 \n", "392 Natalie Portman|Hugo Weaving|Stephen Rea|Steph... 132 \n", "393 Tom Cruise|Kenneth Branagh|Bill Nighy|Tom Wilk... 121 \n", "394 Colin Egglesfield|Stephanie Chao|Roger Yuan|Pa... 84 \n", "395 Tak Sakaguchi|Hideo Sakaki|Chieko Misaka|Kenji... 119 \n", "396 James Woods|Sonja Smits|Deborah Harry|Peter Dv... 87 \n", "397 Roger Moore|Christopher Walken|Tanya Roberts|G... 131 \n", "398 Tyrese Gibson|Shawn Parr|Henry Hunter Hall|Joh... 97 \n", "399 Nat Faxon|John C. Reilly|Tim Meadows|Conner Ra... 96 \n", "400 Michael Bowen|Johnny Knoxville|Dwayne Johnson|... 86 \n", "401 Jet Li|Jason Statham|John Lone|Devon Aoki|Luis... 103 \n", "402 John Cusack|Hilary Duff|Marisa Tomei|Joan Cusa... 107 \n", "403 Tom Cruise|Dakota Fanning|Miranda Otto|Justin ... 116 \n", "404 Jean Reno|Ryôko Hirosue|Michel Muller|Carole B... 94 \n", "405 Ryan Phillippe|Benicio Del Toro|Juliette Lewis... 119 \n", "406 Mel Gibson|Madeleine Stowe|Greg Kinnear|Sam El... 138 \n", "407 Richard Burton|Clint Eastwood|Mary Ure|Patrick... 158 \n", "408 William Holden|Ernest Borgnine|Robert Ryan|Edm... 145 \n", "409 Hugh Jackman|Patrick Stewart|Ian McKellen|Famk... 104 \n", "410 Patrick Stewart|Hugh Jackman|Ian McKellen|Hall... 133 \n", "411 Hugh Jackman|Halle Berry|Ian McKellen|Patrick ... 104 \n", "412 Vin Diesel|Asia Argento|Marton Csokas|Samuel L... 124 \n", "413 Willem Dafoe|Samuel L. Jackson|Ice Cube|Scott ... 101 \n", "414 Robert Mitchum|Ken Takakura|Brian Keith|Herb E... 123 \n", "415 Mark Wahlberg|Joaquin Phoenix|Charlize Theron|... 115 \n", "416 Ben Kingsley|Téa Leoni|Luke Wilson|Dennis Fari... 93 \n", "417 Sean Connery|Akiko Wakabayashi|Mie Hama|Tetsur... 117 \n", "418 Jake Gyllenhaal|Mark Ruffalo|Anthony Edwards|R... 157 \n", "419 Ben Stiller|Owen Wilson|Christine Taylor|Will ... 89 \n", "420 Stanley Baker|Jack Hawkins|Ulla Jacobsson|Jame... 138 \n", "\n", " IMDB_Rating \n", "0 7.4 \n", "1 7.8 \n", "2 7.8 \n", "3 6.4 \n", "4 7.2 \n", "5 5.9 \n", "6 5.0 \n", "7 6.2 \n", "8 5.5 \n", "9 8.1 \n", "10 6.2 \n", "11 8.5 \n", "12 4.7 \n", "13 6.9 \n", "14 6.9 \n", "15 7.8 \n", "16 5.2 \n", "17 7.1 \n", "18 7.6 \n", "19 5.7 \n", "20 6.5 \n", "21 8.5 \n", "22 7.8 \n", "23 6.8 \n", "24 6.6 \n", "25 7.6 \n", "26 7.4 \n", "27 6.3 \n", "28 7.8 \n", "29 6.2 \n", ".. ... \n", "391 8.7 \n", "392 8.2 \n", "393 7.1 \n", "394 3.3 \n", "395 6.6 \n", "396 7.3 \n", "397 6.3 \n", "398 5.9 \n", "399 6.7 \n", "400 6.2 \n", "401 6.2 \n", "402 5.7 \n", "403 6.5 \n", "404 6.6 \n", "405 6.7 \n", "406 7.1 \n", "407 7.7 \n", "408 8.1 \n", "409 7.4 \n", "410 7.5 \n", "411 6.8 \n", "412 5.8 \n", "413 4.2 \n", "414 7.3 \n", "415 6.4 \n", "416 6.6 \n", "417 6.9 \n", "418 7.7 \n", "419 6.6 \n", "420 7.8 \n", "\n", "[421 rows x 9 columns]" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "film_deaths.describe()\n", "film_deaths" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "In ipython and the jupyter notebook it is possible to see a list of all possible functions and attributes by typing the name of the object followed by . for example in the above case if we type film_deaths. it show the columns available (these are attributes in pandas dataframes) such as Body_Count, and also functions, such as .describe().\n", "\n", "For functions we can also see the documentation about the function by following the name with a question mark. This will open a box with documentation at the bottom which can be closed with the x button." ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false }, "outputs": [], "source": [ "film_deaths.describe?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The film deaths data is stored in an object known as a 'data frame'. Data frames come from the statistical family of programming languages based on `S`, the most widely used of which is [`R`](http://en.wikipedia.org/wiki/R_(programming_language)). The data frame gives us a convenient object for manipulating data. The describe method summarizes which columns there are in the data frame and gives us counts, means, standard deviations and percentiles for the values in those columns. To access a column directly we can write" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "0 2002\n", "1 2007\n", "2 2006\n", "3 1999\n", "4 1971\n", "5 1988\n", "6 1988\n", "7 1990\n", "8 2005\n", "9 1988\n", "10 2002\n", "11 1979\n", "12 2007\n", "13 2006\n", "14 1980\n", "...\n", "406 2002\n", "407 1968\n", "408 1969\n", "409 2000\n", "410 2003\n", "411 2006\n", "412 2002\n", "413 2005\n", "414 1974\n", "415 2000\n", "416 2007\n", "417 1967\n", "418 2007\n", "419 2001\n", "420 1964\n", "Name: Year, Length: 421, dtype: int64" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "film_deaths['Year']\n", "#print film_deaths['Body_Count']" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This shows the number of deaths per film across the years. We can plot the data as follows." ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "collapsed": false, "scrolled": true }, "outputs": [ { "data": { "text/plain": [ "[]" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": [ "iVBORw0KGgoAAAANSUhEUgAAAX8AAAEACAYAAABbMHZzAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\n", "AAALEgAACxIB0t1+/AAAIABJREFUeJztnX3UXFV97z8/QKpor4+57U14c5JWuYoNrW0FG7DGXhu5\n", "pgIqjfRqF0FvV1fTVrqKkcS0y6e9l6KwrtrbBbUXa1e0Jt6ILaLQkEB5vCUqkZdoSHhMggQJkgcF\n", "AgSk5OV3/9j7ZM6cOTNzZubMW+b7WWuvOWfPOfv89pkz373Pb7+ZuyOEEGK8OGbQBgghhOg/En8h\n", "hBhDJP5CCDGGSPyFEGIMkfgLIcQYIvEXQogxpKX4m9mlZrbVzO4zs0tj3Cwz22hmO8xsg5lNpI5f\n", "aWY7zWzazBb10nghhBCd0VT8zewXgP8OvAH4ReC3zOzngRXARnc/Dbgt7mNmpwPvAU4HzgWuNTO9\n", "XQghxJDRSphfA9zp7s+7+yHg68C7gfOA1fGY1cAFcft8YK27H3D33cAu4MzSrRZCCNEVrcT/PuBN\n", "0c1zAvB24BRgtrvPxGNmgNlx+yRgT+r8PcDJJdorhBCiBI5r9qW7T5vZx4ENwLPAFuBQ5hg3s2Zz\n", "RGj+CCGEGDKaij+Au38W+CyAmV1BqM3PmNkcd99rZicCj8XDHwFOTZ1+SoyroUVhIYQQogHubmUl\n", "1DQA/yl+vhK4H3g5cBVweYxfAXwsbp9OeDs4HpgHPABYTpre6rrDHIDJQdsg+wdvx7jZLvsHH8rU\n", "zpY1f+B6M/uPwAFgmbs/ZWYfA9aZ2QeA3cCSaNV2M1sHbAcOxuNVyxdCiCGjiNvn13PingDe2uD4\n", "vwL+qnv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9CdnG2rZ/g16K//uBZWZ2F+F1JhkUMQl8\n", "0t2fIwxwGFYa2f9D4FR3fz3wp8Aay7RnDAmN7D8OOIdQaz4HeKeZ/QbDNzivkf0AmNlZwHPuvj3v\n", "5CEg134zex/B3XMiYRDPh6KQDhON7v1nCQJzF/BJ4BvAIYbg2YmVyi8Dl7r7M+nvPPhBBm5jMwZh\n", "f+ldPRPc/XvA2wDM7DTg7fGrM4F3m9lVwARw2Mx+AvwToRaRcAqh9BoIOfYvjvEvEP8M7n6PmT1A\n", "GJ34CCNgP/Aw8P/c/Yn43c3ALwP/yGjYn3ARsCa1P+z3P3n+FwD/7O6HgB+Z2SZCDfoOhsT+Js/+\n", "IUKFh/jdJmAH8BQDtN3MXkQQzs+7ezLqeMbM5rj73ugSeSzGP0LtW+QphAJtYM9Pm/Y3om37e1bz\n", "N7OfjZ/HAH8GfBrA3X/d3ee5+zzgU8AV7n6tu+8l+D7PMjMDfpf64eN9I8f+v437PxP9tZjZzxGE\n", "//vu/igjYD9h/MV8M3uJhQF5bwa2jcr9T8X9NvDFJG4E7v+n41fTwG/E714KvBGYHqb73+TZf0m0\n", "GTP7TeCAu08P8t7H6/09sN3dP5X66kbg4rh9ccqeG4GLLPRcmkf4/24e1P3vwP4jp6Z3OvoNSmqx\n", "Xktwh7xAqFm+nzBPxvdi+KsG530U+NPU/q8AWwmNMP+7DNvKth94F3AfYU6Uu0lNcDYK9sfj3xvz\n", "sJXUsoEjZP9C4Bs56Qy9/cBPEd6ythLmt7lskPa3aftcQuG1HdhAcH8O+t6fQ5g3Z0v8T95LWE9k\n", "FqGxeke0NT0x40eindPA2wZ8/zuxfzfwOGH+ooeB13RivwZ5CSHEGNLLBl8hhBBDisRfCCHGEIm/\n", "EEKMIRJ/IYQYQyT+Qggxhkj8hRBiDJH4CyHEGCLxF0KIMeT/AxeKr0Aqw30WAAAAAElFTkSuQmCC\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# this ensures the plot appears in the web browser\n", "%matplotlib inline \n", "import pylab as plt # this imports the plotting library in python\n", "\n", "plt.plot(film_deaths['Year'], film_deaths['Body_Count'], 'rx')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "You may be curious what the arguments we give to plt.plot are for, now is the perfect time to look at the documentation" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "collapsed": false }, "outputs": [], "source": [ "plt.plot?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We immediately note that some films have a lot of deaths, which prevent us seeing the detail of the main body of films. First lets identify the films with the most deaths." ] }, { "cell_type": "code", "execution_count": 8, "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", "
FilmYearBody_CountMPAA_RatingGenreDirectorActorsLength_MinutesIMDB_Rating
60 Dip huet gaai tau 1990 214 NaN Crime|Drama|Thriller John Woo Tony Leung Chiu Wai|Jacky Cheung|Waise Lee|Sim... 136 7.7
117 Equilibrium 2002 236 R Action|Drama|Sci-Fi|Thriller Kurt Wimmer Christian Bale|Dominic Purcell|Sean Bean|Chris... 107 7.6
154 Grindhouse 2007 310 R Action|Horror|Thriller Robert Rodriguez|Eli Roth|Quentin Tarantino|Ed... Kurt Russell|Zoë Bell|Rosario Dawson|Vanessa F... 191 7.7
159 Lat sau san taam 1992 307 R Action|Crime|Drama|Thriller John Woo Yun-Fat Chow|Tony Leung Chiu Wai|Teresa Mo|Phi... 128 8.0
193 Kingdom of Heaven 2005 610 R Action|Adventure|Drama|History|War Ridley Scott Martin Hancock|Michael Sheen|Nathalie Cox|Eriq... 144 7.2
206 The Last Samurai 2003 558 R Action|Drama|History|War Edward Zwick Ken Watanabe|Tom Cruise|William Atherton|Chad ... 154 7.7
222 The Lord of the Rings: The Two Towers 2002 468 PG-13 Action|Adventure|Fantasy Peter Jackson Bruce Allpress|Sean Astin|John Bach|Sala Baker... 179 8.8
223 The Lord of the Rings: The Return of the King 2003 836 PG-13 Action|Adventure|Fantasy Peter Jackson Noel Appleby|Alexandra Astin|Sean Astin|David ... 201 8.9
291 Rambo 2008 247 R Action|Thriller|War Sylvester Stallone Sylvester Stallone|Julie Benz|Matthew Marsden|... 92 7.1
317 Saving Private Ryan 1998 255 R Action|Drama|War Steven Spielberg Tom Hanks|Tom Sizemore|Edward Burns|Barry Pepp... 169 8.6
349 Starship Troopers 1997 256 R Action|Sci-Fi Paul Verhoeven Casper Van Dien|Dina Meyer|Denise Richards|Jak... 129 7.2
375 Titanic 1997 307 PG-13 Drama|Romance James Cameron Leonardo DiCaprio|Kate Winslet|Billy Zane|Kath... 194 7.7
382 Troy 2004 572 R Adventure|Drama Wolfgang Petersen Julian Glover|Brian Cox|Nathan Jones|Adoni Mar... 163 7.2
406 We Were Soldiers 2002 305 R Action|Drama|History|War Randall Wallace Mel Gibson|Madeleine Stowe|Greg Kinnear|Sam El... 138 7.1
\n", "
" ], "text/plain": [ " Film Year Body_Count \\\n", "60 Dip huet gaai tau 1990 214 \n", "117 Equilibrium 2002 236 \n", "154 Grindhouse 2007 310 \n", "159 Lat sau san taam 1992 307 \n", "193 Kingdom of Heaven 2005 610 \n", "206 The Last Samurai 2003 558 \n", "222 The Lord of the Rings: The Two Towers 2002 468 \n", "223 The Lord of the Rings: The Return of the King 2003 836 \n", "291 Rambo 2008 247 \n", "317 Saving Private Ryan 1998 255 \n", "349 Starship Troopers 1997 256 \n", "375 Titanic 1997 307 \n", "382 Troy 2004 572 \n", "406 We Were Soldiers 2002 305 \n", "\n", " MPAA_Rating Genre \\\n", "60 NaN Crime|Drama|Thriller \n", "117 R Action|Drama|Sci-Fi|Thriller \n", "154 R Action|Horror|Thriller \n", "159 R Action|Crime|Drama|Thriller \n", "193 R Action|Adventure|Drama|History|War \n", "206 R Action|Drama|History|War \n", "222 PG-13 Action|Adventure|Fantasy \n", "223 PG-13 Action|Adventure|Fantasy \n", "291 R Action|Thriller|War \n", "317 R Action|Drama|War \n", "349 R Action|Sci-Fi \n", "375 PG-13 Drama|Romance \n", "382 R Adventure|Drama \n", "406 R Action|Drama|History|War \n", "\n", " Director \\\n", "60 John Woo \n", "117 Kurt Wimmer \n", "154 Robert Rodriguez|Eli Roth|Quentin Tarantino|Ed... \n", "159 John Woo \n", "193 Ridley Scott \n", "206 Edward Zwick \n", "222 Peter Jackson \n", "223 Peter Jackson \n", "291 Sylvester Stallone \n", "317 Steven Spielberg \n", "349 Paul Verhoeven \n", "375 James Cameron \n", "382 Wolfgang Petersen \n", "406 Randall Wallace \n", "\n", " Actors Length_Minutes \\\n", "60 Tony Leung Chiu Wai|Jacky Cheung|Waise Lee|Sim... 136 \n", "117 Christian Bale|Dominic Purcell|Sean Bean|Chris... 107 \n", "154 Kurt Russell|Zoë Bell|Rosario Dawson|Vanessa F... 191 \n", "159 Yun-Fat Chow|Tony Leung Chiu Wai|Teresa Mo|Phi... 128 \n", "193 Martin Hancock|Michael Sheen|Nathalie Cox|Eriq... 144 \n", "206 Ken Watanabe|Tom Cruise|William Atherton|Chad ... 154 \n", "222 Bruce Allpress|Sean Astin|John Bach|Sala Baker... 179 \n", "223 Noel Appleby|Alexandra Astin|Sean Astin|David ... 201 \n", "291 Sylvester Stallone|Julie Benz|Matthew Marsden|... 92 \n", "317 Tom Hanks|Tom Sizemore|Edward Burns|Barry Pepp... 169 \n", "349 Casper Van Dien|Dina Meyer|Denise Richards|Jak... 129 \n", "375 Leonardo DiCaprio|Kate Winslet|Billy Zane|Kath... 194 \n", "382 Julian Glover|Brian Cox|Nathan Jones|Adoni Mar... 163 \n", "406 Mel Gibson|Madeleine Stowe|Greg Kinnear|Sam El... 138 \n", "\n", " IMDB_Rating \n", "60 7.7 \n", "117 7.6 \n", "154 7.7 \n", "159 8.0 \n", "193 7.2 \n", "206 7.7 \n", "222 8.8 \n", "223 8.9 \n", "291 7.1 \n", "317 8.6 \n", "349 7.2 \n", "375 7.7 \n", "382 7.2 \n", "406 7.1 " ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "film_deaths[film_deaths['Body_Count']>200]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Here we are using the command `film_deaths['Kill_Count']>200` to index the films in the pandas data frame which have over 200 deaths. To sort them in order we can also use the `sort` command. The result of this command on its own is a data series of `True` and `False` values. However, when it is passed to the `film_deaths` data frame it returns a new data frame which contains only those values for which the data series is `True`. We can also sort the result. To sort the result by the values in the `Kill_Count` column in *descending* order we use the following command." ] }, { "cell_type": "code", "execution_count": 9, "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", "
FilmYearBody_CountMPAA_RatingGenreDirectorActorsLength_MinutesIMDB_Rating
223 The Lord of the Rings: The Return of the King 2003 836 PG-13 Action|Adventure|Fantasy Peter Jackson Noel Appleby|Alexandra Astin|Sean Astin|David ... 201 8.9
193 Kingdom of Heaven 2005 610 R Action|Adventure|Drama|History|War Ridley Scott Martin Hancock|Michael Sheen|Nathalie Cox|Eriq... 144 7.2
382 Troy 2004 572 R Adventure|Drama Wolfgang Petersen Julian Glover|Brian Cox|Nathan Jones|Adoni Mar... 163 7.2
206 The Last Samurai 2003 558 R Action|Drama|History|War Edward Zwick Ken Watanabe|Tom Cruise|William Atherton|Chad ... 154 7.7
222 The Lord of the Rings: The Two Towers 2002 468 PG-13 Action|Adventure|Fantasy Peter Jackson Bruce Allpress|Sean Astin|John Bach|Sala Baker... 179 8.8
154 Grindhouse 2007 310 R Action|Horror|Thriller Robert Rodriguez|Eli Roth|Quentin Tarantino|Ed... Kurt Russell|Zoë Bell|Rosario Dawson|Vanessa F... 191 7.7
159 Lat sau san taam 1992 307 R Action|Crime|Drama|Thriller John Woo Yun-Fat Chow|Tony Leung Chiu Wai|Teresa Mo|Phi... 128 8.0
375 Titanic 1997 307 PG-13 Drama|Romance James Cameron Leonardo DiCaprio|Kate Winslet|Billy Zane|Kath... 194 7.7
406 We Were Soldiers 2002 305 R Action|Drama|History|War Randall Wallace Mel Gibson|Madeleine Stowe|Greg Kinnear|Sam El... 138 7.1
349 Starship Troopers 1997 256 R Action|Sci-Fi Paul Verhoeven Casper Van Dien|Dina Meyer|Denise Richards|Jak... 129 7.2
317 Saving Private Ryan 1998 255 R Action|Drama|War Steven Spielberg Tom Hanks|Tom Sizemore|Edward Burns|Barry Pepp... 169 8.6
291 Rambo 2008 247 R Action|Thriller|War Sylvester Stallone Sylvester Stallone|Julie Benz|Matthew Marsden|... 92 7.1
117 Equilibrium 2002 236 R Action|Drama|Sci-Fi|Thriller Kurt Wimmer Christian Bale|Dominic Purcell|Sean Bean|Chris... 107 7.6
60 Dip huet gaai tau 1990 214 NaN Crime|Drama|Thriller John Woo Tony Leung Chiu Wai|Jacky Cheung|Waise Lee|Sim... 136 7.7
\n", "
" ], "text/plain": [ " Film Year Body_Count \\\n", "223 The Lord of the Rings: The Return of the King 2003 836 \n", "193 Kingdom of Heaven 2005 610 \n", "382 Troy 2004 572 \n", "206 The Last Samurai 2003 558 \n", "222 The Lord of the Rings: The Two Towers 2002 468 \n", "154 Grindhouse 2007 310 \n", "159 Lat sau san taam 1992 307 \n", "375 Titanic 1997 307 \n", "406 We Were Soldiers 2002 305 \n", "349 Starship Troopers 1997 256 \n", "317 Saving Private Ryan 1998 255 \n", "291 Rambo 2008 247 \n", "117 Equilibrium 2002 236 \n", "60 Dip huet gaai tau 1990 214 \n", "\n", " MPAA_Rating Genre \\\n", "223 PG-13 Action|Adventure|Fantasy \n", "193 R Action|Adventure|Drama|History|War \n", "382 R Adventure|Drama \n", "206 R Action|Drama|History|War \n", "222 PG-13 Action|Adventure|Fantasy \n", "154 R Action|Horror|Thriller \n", "159 R Action|Crime|Drama|Thriller \n", "375 PG-13 Drama|Romance \n", "406 R Action|Drama|History|War \n", "349 R Action|Sci-Fi \n", "317 R Action|Drama|War \n", "291 R Action|Thriller|War \n", "117 R Action|Drama|Sci-Fi|Thriller \n", "60 NaN Crime|Drama|Thriller \n", "\n", " Director \\\n", "223 Peter Jackson \n", "193 Ridley Scott \n", "382 Wolfgang Petersen \n", "206 Edward Zwick \n", "222 Peter Jackson \n", "154 Robert Rodriguez|Eli Roth|Quentin Tarantino|Ed... \n", "159 John Woo \n", "375 James Cameron \n", "406 Randall Wallace \n", "349 Paul Verhoeven \n", "317 Steven Spielberg \n", "291 Sylvester Stallone \n", "117 Kurt Wimmer \n", "60 John Woo \n", "\n", " Actors Length_Minutes \\\n", "223 Noel Appleby|Alexandra Astin|Sean Astin|David ... 201 \n", "193 Martin Hancock|Michael Sheen|Nathalie Cox|Eriq... 144 \n", "382 Julian Glover|Brian Cox|Nathan Jones|Adoni Mar... 163 \n", "206 Ken Watanabe|Tom Cruise|William Atherton|Chad ... 154 \n", "222 Bruce Allpress|Sean Astin|John Bach|Sala Baker... 179 \n", "154 Kurt Russell|Zoë Bell|Rosario Dawson|Vanessa F... 191 \n", "159 Yun-Fat Chow|Tony Leung Chiu Wai|Teresa Mo|Phi... 128 \n", "375 Leonardo DiCaprio|Kate Winslet|Billy Zane|Kath... 194 \n", "406 Mel Gibson|Madeleine Stowe|Greg Kinnear|Sam El... 138 \n", "349 Casper Van Dien|Dina Meyer|Denise Richards|Jak... 129 \n", "317 Tom Hanks|Tom Sizemore|Edward Burns|Barry Pepp... 169 \n", "291 Sylvester Stallone|Julie Benz|Matthew Marsden|... 92 \n", "117 Christian Bale|Dominic Purcell|Sean Bean|Chris... 107 \n", "60 Tony Leung Chiu Wai|Jacky Cheung|Waise Lee|Sim... 136 \n", "\n", " IMDB_Rating \n", "223 8.9 \n", "193 7.2 \n", "382 7.2 \n", "206 7.7 \n", "222 8.8 \n", "154 7.7 \n", "159 8.0 \n", "375 7.7 \n", "406 7.1 \n", "349 7.2 \n", "317 8.6 \n", "291 7.1 \n", "117 7.6 \n", "60 7.7 " ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "film_deaths[film_deaths['Body_Count']>200].sort(columns='Body_Count', ascending=False)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We now see that the 'Lord of the Rings' is a large outlier with a very large number of kills. We can try and determine how much of an outlier by histograming the data. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Plotting the Data" ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": [ "iVBORw0KGgoAAAANSUhEUgAAAXsAAAEKCAYAAADzQPVvAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\n", "AAALEgAACxIB0t1+/AAAG85JREFUeJzt3X20XHV97/H3hycVwiUGNYQnTwqkmqoNWiNWkYMgxVpB\n", "7+0C4qUSoV1dpVeQu9qS2N6Sa1ctuIra1uK6tSKRSjDilUK7QALl3FKpoDXhKeZKLh4lSgJCiAF8\n", "APK9f+zfJMNkZs4+Z2b2/k3m81pr1tl7z374nJk5373nu/fMUURgZmZ7tr3qDmBmZoPnYm9mNgJc\n", "7M3MRoCLvZnZCHCxNzMbAS72ZmYjwMV+hEi6X9Lb6s5RJ0nvlfSwpO2SfrnkMkem+ZXGJySdN9ik\n", "O7e9XdJYGr5K0p+l4XFJD1eRwfYMLvZ7CEmTkk5qm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/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "film_deaths['Body_Count'].hist(bins=20) # histogram the data with 20 bins.\n", "plt.title('Histogram of Film Kill Count')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We could try and remove these outliers, but another approach would be plot the logarithm of the counts against the year." ] }, { "cell_type": "code", "execution_count": 11, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": [ "iVBORw0KGgoAAAANSUhEUgAAAY4AAAEZCAYAAACAZ8KHAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\n", "AAALEgAACxIB0t1+/AAAIABJREFUeJztnXu8JEV1+L8HEB+IriaKxkcviS+MVyFGMbsQNxpWDARU\n", "YI2P6F1/icQ1an7i8nBNvCZZQdaAxuALFVfl4eIDFcwqGBZxQREEXUBexgVBREVW8Keiwvn9UTU7\n", "Pd01M9U93dPd957v53M+905Nd/Wp6p46XXWqTomqYhiGYRix7NC0AoZhGEa3MMNhGIZhFMIMh2EY\n", "hlEIMxyGYRhGIcxwGIZhGIUww2EYhmEUwgyHMTEicpeILPb/f1RE/q1ZjcojIptE5P80rccwRGRf\n", "EbmmaT2MhY0ZDiMaEdkqIr/0huIuEblTRB6hqruq6lZ/mHqp4nofFZG7/XXuFJEtIvJ2EXlQRfnP\n", "icjHM8mV6V8Hqnqhqj5p0nz8vXzOkO92E5GfiMizM+kfEZHTJ7220X3McBhFUOBAbyh2VdUHqeqP\n", "AsdJhdd7h6o+CPh9YCXwLGCziDygomssVJQh90lVbwP+L3CyiNwPQESeCxwA/GNVCoiItT8dxW6c\n", "MTEicq+I/GEgfZmI3Cwiq0XkxyLyQxF5gYj8lYhcJyK3i8jR47IHUNXfqOqlwEHA7+GMSO86rxKR\n", "q0XkZyKyUUQem/ru3SJyk4j8XEQuFZF9fPr+wDHAi33v6fLUNReLyNd8L+dLIvJ7/pz7icgnROSn\n", "InKHiFwi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ar/f+vTOnzeeBvxM0Q2x33+72kqXtQQv/tp6Y/FL4HdXv9I2cGnI4bwvkN7o32VcDr\n", "cTMErgXePuS8twJvTH1+OrAF57D6zzbqjwsdfyVwOXAZcECX9PfHv8yXYQt+tkbH9F8GXBTIZ+r6\n", "F3x27ovr2W0BrmJwRmHr6x43C+ka3KSWL+OGbJvWfx/gXtxMqcu97A88FOfYv87ruih1zpu9ntfg\n", "Qic1+fyU0X8rcDtwl79nTyqq/1RiVRmGYRjzh9YOVRmGYRjtxAyHYRiGUQgzHIZhGEYhzHAYhmEY\n", "hTDDYRiGYRTCDIdhGIZRCDMchmEYRiHMcBhGA/hV1YbRSezhNYwxiMjbROQNqc9rReT1IrJaRC4R\n", "kW+LyFzq+8+KyKXiNtb5+1T6L0TknSJyBS5ciGF0EjMchjGejwCvgO09hRcDPwIep6rPxIWyfrqI\n", "7OuPf5Wq/inwDOD1IvIQn/4A4OuquqeqXjTVEhhGhbQ2Oq5htAVVvVFEbheRPXE7rl2OMwrLReRy\n", "f9guwOOAC4E3iNtsDFwk1cfjdle7BxfF1DA6jRkOw4jjQ7htUHfD9UCeCxyrqh9MHyQiy/x3z1LV\n", "X4vI+cD9/Ne/VgsOZ8wDbKjKMOL4LC7q6J8CG3Hh5V+VChP+KB9O/EHAHd5oPAnzZRjzEOtxGEYE\n", "qvpbEfkfnFFQ4FwR2QO42G1fwF3Ay3FG5R9E5GpcWPGL09lMWW3DqAULq24YEXin+GXAoar6vab1\n", "MYwmsaEqwxiDiDwZuB44z4yGYViPwzAMwyiI9TgMwzCMQpjhMAzDMAphhsMwDMMohBkOwzAMoxBm\n", "OAzDMIxCmOEwDMMwCvH/ARej82uYWs22AAAAAElFTkSuQmCC\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "plt.plot(film_deaths['Year'], film_deaths['Body_Count'], 'rx')\n", "ax = plt.gca() # obtain a handle to the current axis\n", "ax.set_yscale('log') # use a logarithmic death scale\n", "# give the plot some titles and labels\n", "plt.title('Film Deaths against Year')\n", "plt.ylabel('deaths')\n", "plt.xlabel('year')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Note a few things. We are interacting with our data. In particular, we are replotting the data according to what we have learned so far. We are using the progamming language as a *scripting* language to give the computer one command or another, and then the next command we enter is dependent on the result of the previous. This is a very different paradigm to classical software engineering. In classical software engineering we normally write many lines of code (entire object classes or functions) before compiling the code and running it. Our approach is more similar to the approach we take whilst debugging. Historically, researchers interacted with data using a *console*. A command line window which allowed command entry. The notebook format we are using is slightly different. Each of the code entry boxes acts like a separate console window. We can move up and down the notebook and run each part in a different order. The *state* of the program is always as we left it after running the previous part. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Probabilities\n", "\n", "We are now going to do some simple review of probabilities and use this review to explore some aspects of our data.\n", "\n", "A probability distribution expresses uncertainty about the outcome of an event. We often encode this uncertainty in a variable. So if we are considering the outcome of an event, $Y$, to be a coin toss, then we might consider $Y=1$ to be heads and $Y=0$ to be tails. We represent the probability of a given outcome with the notation:\n", "$$\n", "P(Y=1) = 0.5\n", "$$\n", "The first rule of probability is that the probability must normalize. The sum of the probability of all events must equal 1. So if the probability of heads ($Y=1$) is 0.5, then the probability of tails (the only other possible outcome) is given by\n", "$$\n", "P(Y=0) = 1-P(Y=1) = 0.5\n", "$$\n", "\n", "Probabilities are often defined as the limit of the ratio between the number of positive outcomes (e.g. *heads*) given the number of trials. If the number of positive outcomes for event $y$ is denoted by $n$ and the number of trials is denoted by $N$ then this gives the ratio \n", "$$\n", "P(Y=y) = \\lim_{N\\rightarrow \\infty}\\frac{n_y}{N}.\n", "$$\n", "In practice we never get to observe an event infinite times, so rather than considering this we often use the following estimate\n", "$$\n", "P(Y=y) \\approx \\frac{n_y}{N}.\n", "$$\n", "Let's use this rule to compute the approximate probability that a film from the movie body count website has over 40 deaths." ] }, { "cell_type": "code", "execution_count": 12, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Probability of deaths being greather than 40 is: 0.377672209026\n" ] } ], "source": [ "deaths = (film_deaths.Body_Count>40).sum() # number of positive outcomes (in sum True counts as 1, False counts as 0)\n", "total_films = film_deaths.Body_Count.count()\n", "\n", "prob_death = float(deaths)/float(total_films)\n", "print \"Probability of deaths being greather than 40 is:\", prob_death" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Conditioning\n", "\n", "When predicting whether a coin turns up head or tails, we might think that this event is *independent* of the year or time of day. If we include an observation such as time, then in a probability this is known as *condtioning*. We use this notation, $P(Y=y|T=t)$, to condition the outcome on a second variable (in this case time). Or, often, for a shorthand we use $P(y|t)$ to represent this distribution (the $Y=$ and $T=$ being implicit). Because we don't believe a coin toss depends on time then we might write that \n", "$$\n", "P(y|t) = p(y).\n", "$$\n", "However, we might believe that the number of deaths is dependent on the year. For this we can try estimating $P(Y>40 | T=2000)$ and compare the result, for example to $P(Y>40|2002)$ using our empirical estimate of the probability." ] }, { "cell_type": "code", "execution_count": 13, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Probability of deaths being greather than 40 in year 2000 is: 0.166666666667\n", "Probability of deaths being greather than 40 in year 2002 is: 0.407407407407\n" ] } ], "source": [ "for year in [2000, 2002]:\n", " deaths = (film_deaths.Body_Count[film_deaths.Year==year]>40).sum()\n", " total_films = (film_deaths.Year==year).sum()\n", "\n", " prob_death = float(deaths)/float(total_films)\n", " print \"Probability of deaths being greather than 40 in year\", year, \"is:\", prob_death" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Rules of Probability\n", "\n", "We've now introduced conditioning and independence to the notion of probability and computed some conditional probabilities on a practical example The scatter plot of deaths vs year that we created above can be seen as a *joint* probability distribution. We represent a joint probability using the notation $P(Y=y, T=t)$ or $P(y, t)$ for short. Computing a joint probability is equivalent to answering the simultaneous questions, what's the probability that the number of deaths was over 40 and the year was 2002? Or any other question that may occur to us. Again we can easily use pandas to ask such questions.\n" ] }, { "cell_type": "code", "execution_count": 14, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Probability of deaths being greather than 40 and year being 2000 is: 0.00712589073634\n" ] } ], "source": [ "year = 2000\n", "deaths = (film_deaths.Body_Count[film_deaths.Year==year]>40).sum()\n", "total_films = film_deaths.Body_Count.count() # this is total number of films\n", "prob_death = float(deaths)/float(total_films)\n", "print \"Probability of deaths being greather than 40 and year being\", year, \"is:\", prob_death" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### The Product Rule\n", "\n", "This number is the joint probability, $P(Y, T)$ which is much *smaller* than the conditional probability. The number can never be bigger than the conditional probabililty because it is computed using the *product rule*.\n", "$$\n", "p(Y=y, T=t) = p(Y=y|T=t)p(T=t)\n", "$$\n", "and $$p(T=t)$$ is a probability distribution, which is equal or less than 1, ensuring the joint distribution is typically smaller than the conditional distribution.\n", "\n", "The product rule is a *fundamental* rule of probability, and you must remember it! It gives the relationship between the two questions: 1) What's the probability that a film was made in 2002 and has over 40 deaths? and 2) What's the probability that a film has over 40 deaths given that it was made in 2002?\n", "\n", "In our shorter notation we can write the product rule as\n", "$$\n", "p(y, t) = p(y|t)p(t)\n", "$$\n", "We can see the relation working in practice for our data above by computing the different values for $t=2000$." ] }, { "cell_type": "code", "execution_count": 15, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "P(t) is 0.0641330166271\n", "P(y|t) is 0.407407407407\n", "P(y,t) is 0.0261282660333\n" ] } ], "source": [ "p_t = float((film_deaths.Year==2002).sum())/float(film_deaths.Body_Count.count())\n", "p_y_given_t = float((film_deaths.Body_Count[film_deaths.Year==2002]>40).sum())/float((film_deaths.Year==2002).sum())\n", "p_y_and_t = float((film_deaths.Body_Count[film_deaths.Year==2002]>40).sum())/float(film_deaths.Body_Count.count())\n", "\n", "print \"P(t) is\", p_t\n", "print \"P(y|t) is\", p_y_given_t\n", "print \"P(y,t) is\", p_y_and_t" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### The Sum Rule\n", "\n", "The other *fundamental rule* of probability is the *sum rule* this tells us how to get a *marginal* distribution from the joint distribution. Simply put it says that we need to sum across the value we'd like to remove.\n", "$$\n", "P(Y=y) = \\sum_{t} P(Y=y, T=t)\n", "$$\n", "Or in our shortened notation\n", "$$\n", "P(y) = \\sum_{t} P(y, t)\n", "$$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Bayes' Rule\n", "\n", "Bayes rule is a very simple rule, it's hardly worth the name of a rule at all. It follows directly from the product rule of probability. Because $P(y, t) = P(y|t)P(t)$ and by symmetry $P(y,t)=P(t,y)=P(t|y)P(y)$ then by equating these two equations and dividing through by $P(y)$ we have\n", "$$\n", "P(t|y) = \\frac{P(y|t)P(t)}{P(y)}\n", "$$\n", "which is known as Bayes' rule (or Bayes's rule, it depends how you choose to pronounce it). It's not difficult to derive, and its importance is more to do with the semantic operation that it enables. Each of these probability distributions represents the answer to a question we have about the world. Bayes rule (via the product rule) tells us how to *invert* the probability." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## More Fun on the Python Data Farm\n", "\n", "If you want to explore more of the things you can do with movies and python you might be interested in the `imdbpy` python library. \n", "\n", "You can try installing it using `easy_install` as follows." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "!easy_install -U IMDbPY" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "If this doesn't work on your machine, try following instructions on (http://imdbpy.sourceforge.net/)\n", "\n", "Once you've installed `imdbpy` you can test it works with the following script, which should list movies with the word 'python' in their title. To run the code in the following box, simply click the box and press `SHIFT-enter` or `CTRL-enter`. Then you can try running the code below." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "from imdb import IMDb\n", "ia = IMDb()\n", "\n", "for movie in ia.search_movie('python'):\n", " print movie " ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "from IPython.display import YouTubeVideo\n", "YouTubeVideo('GX8VLYUYScM')" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 2", "language": "python", "name": "python2" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.10" } }, "nbformat": 4, "nbformat_minor": 0 }