{ "cells": [ { "cell_type": "markdown", "metadata": { "hideCode": false, "hidePrompt": false }, "source": [ "# Histograms and Density Plots\n", "\n", "In this notebook we will look at the [NYCFlights13 dataset](https://cran.r-project.org/web/packages/nycflights13/nycflights13.pdf), which contains information on over 300,000 planes departing NYC airports in 2013. We will focus on visualizing the distribution of arrival delays given in minutes. " ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "hideCode": false, "hidePrompt": false }, "outputs": [], "source": [ "# Pandas and numpy for data manipulation\n", "import pandas as pd\n", "import numpy as np\n", "\n", "# Matplotlib and seaborn for plotting\n", "import matplotlib.pyplot as plt\n", "import matplotlib\n", "%matplotlib inline\n", "\n", "matplotlib.rcParams['font.size'] = 18\n", "matplotlib.rcParams['figure.dpi'] = 200\n", "\n", "import seaborn as sns\n", "\n", "from IPython.core.pylabtools import figsize" ] }, { "cell_type": "markdown", "metadata": { "hideCode": false, "hidePrompt": false }, "source": [ "## Data Import " ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "hideCode": false, "hidePrompt": false }, "outputs": [ { "data": { "text/html": [ "
\n", " | arr_delay | \n", "name | \n", "
---|---|---|
0 | \n", "11.0 | \n", "United Air Lines Inc. | \n", "
1 | \n", "20.0 | \n", "United Air Lines Inc. | \n", "
2 | \n", "33.0 | \n", "American Airlines Inc. | \n", "
3 | \n", "-18.0 | \n", "JetBlue Airways | \n", "
4 | \n", "-25.0 | \n", "Delta Air Lines Inc. | \n", "
5 | \n", "12.0 | \n", "United Air Lines Inc. | \n", "
6 | \n", "19.0 | \n", "JetBlue Airways | \n", "
7 | \n", "-14.0 | \n", "ExpressJet Airlines Inc. | \n", "
8 | \n", "-8.0 | \n", "JetBlue Airways | \n", "
9 | \n", "8.0 | \n", "American Airlines Inc. | \n", "