{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "Inspired from [Henrik Lindberg's post](https://www.reddit.com/r/dataisbeautiful/comments/6m0wo7/peak_time_for_sports_and_leisure_oc/djy1i3h/) and his original [code](https://github.com/halhen/viz-pub/blob/master/sports-time-of-day/2_gen_chart.R) in R" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "run_control": { "frozen": false, "read_only": false } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Populating the interactive namespace from numpy and matplotlib\n" ] } ], "source": [ "%pylab inline\n", "import seaborn as sns\n", "import pandas as pd\n", "\n", "plt.rcParams['savefig.dpi'] = 100\n", "plt.rcParams['figure.dpi'] = 100\n", "\n", "sns.set_style('white')" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "run_control": { "frozen": false, "read_only": false } }, "outputs": [ { "data": { "text/html": [ "
\n", " | activity | \n", "time | \n", "p | \n", "p_peak | \n", "p_smooth | \n", "
---|---|---|---|---|---|
0 | \n", "Using cardiovascular equipment | \n", "24.000000 | \n", "0.000106 | \n", "0.079316 | \n", "0.079316 | \n", "
1 | \n", "Using cardiovascular equipment | \n", "24.083333 | \n", "0.000076 | \n", "0.057084 | \n", "0.059767 | \n", "
2 | \n", "Using cardiovascular equipment | \n", "24.166667 | \n", "0.000057 | \n", "0.042900 | \n", "0.046373 | \n", "
3 | \n", "Using cardiovascular equipment | \n", "24.250000 | \n", "0.000052 | \n", "0.039133 | \n", "0.039216 | \n", "
4 | \n", "Using cardiovascular equipment | \n", "24.333333 | \n", "0.000047 | \n", "0.035614 | \n", "0.027964 | \n", "