{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "In this notebook, we will \n", " * Compare distributions using probability mass functions\n", " * Use kernel density estimation to compare distributions across different categorical groups\n", " \n", "Again, we will examining [Austin Bikeshare](https://www.kaggle.com/jboysen/austin-bike) data." ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": true }, "outputs": [], "source": [ "import matplotlib.pyplot as plt\n", "import numpy as np\n", "import pandas as pd\n", "import seaborn as sns\n", "\n", "%matplotlib inline\n", "sns.set()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Read in data and do some cleaning" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | bikeid | \n", "checkout_time | \n", "duration_minutes | \n", "end_station_id | \n", "end_station_name | \n", "month | \n", "start_station_id | \n", "start_station_name | \n", "start_time | \n", "subscriber_type | \n", "trip_id | \n", "year | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "8.0 | \n", "19:12:00 | \n", "41 | \n", "2565.0 | \n", "Trinity & 6th Street | \n", "3.0 | \n", "2536.0 | \n", "Waller & 6th St. | \n", "2015-03-19 19:12:00 | \n", "Walk Up | \n", "9900082882 | \n", "2015.0 | \n", "
1 | \n", "141.0 | \n", "2:06:04 | \n", "6 | \n", "2570.0 | \n", "South Congress & Academy | \n", "10.0 | \n", "2494.0 | \n", "2nd & Congress | \n", "2016-10-30 02:06:04 | \n", "Local365 | \n", "12617682 | \n", "2016.0 | \n", "
2 | \n", "578.0 | \n", "16:28:27 | \n", "13 | \n", "2498.0 | \n", "Convention Center / 4th St. @ MetroRail | \n", "3.0 | \n", "2538.0 | \n", "Bullock Museum @ Congress & MLK | \n", "2016-03-11 16:28:27 | \n", "Local365 | \n", "9075366 | \n", "2016.0 | \n", "
3 | \n", "555.0 | \n", "15:12:00 | \n", "80 | \n", "2712.0 | \n", "Toomey Rd @ South Lamar | \n", "11.0 | \n", "2497.0 | \n", "Capitol Station / Congress & 11th | \n", "2014-11-23 15:12:00 | \n", "24-Hour Kiosk (Austin B-cycle) | \n", "9900319298 | \n", "2014.0 | \n", "
4 | \n", "86.0 | \n", "15:39:13 | \n", "25 | \n", "3377.0 | \n", "MoPac Pedestrian Bridge @ Veterans Drive | \n", "4.0 | \n", "2707.0 | \n", "Rainey St @ Cummings | \n", "2017-04-16 15:39:13 | \n", "Walk Up | \n", "14468597 | \n", "2017.0 | \n", "