{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Applying Statistical Thinking and Visualization\n", "\n", "\n", "\n", "The dataset we will be using is from a restaurant and looks like:\n", "\n", "id\t| total_bill\t| tip\t| sex\t| smoker\t| day\t| time\t| size\n", ":---: | :---:| :---: | :---: | :---: | :---: | :---: | :---: \n", "0\t| 16.99 | 1.01\t| Female\t| No\t| Sun\t| Dinner\t| 2\n", "1\t| 10.34 | 1.66\t| Male\t| No\t| Sun\t| Dinner |\t3\n", "2\t| 21.01 | 3.50\t| Male\t| No\t| Sun\t| Dinner |\t3\n", "3\t| 23.68 |\t3.31\t| Male\t| No\t| Sun\t| Dinner | 2\t\n", "\n", "Before you move on, take a minute to look at that table. Seriously. Take 10 seconds out of your life to look at the table above.\n", "\n", "Okay.\n", "\n", "First, Let's load the dataset" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | total_bill | \n", "tip | \n", "sex | \n", "smoker | \n", "day | \n", "time | \n", "size | \n", "
---|---|---|---|---|---|---|---|
0 | \n", "16.99 | \n", "1.01 | \n", "Female | \n", "No | \n", "Sun | \n", "Dinner | \n", "2 | \n", "
1 | \n", "10.34 | \n", "1.66 | \n", "Male | \n", "No | \n", "Sun | \n", "Dinner | \n", "3 | \n", "
2 | \n", "21.01 | \n", "3.50 | \n", "Male | \n", "No | \n", "Sun | \n", "Dinner | \n", "3 | \n", "
3 | \n", "23.68 | \n", "3.31 | \n", "Male | \n", "No | \n", "Sun | \n", "Dinner | \n", "2 | \n", "
4 | \n", "24.59 | \n", "3.61 | \n", "Female | \n", "No | \n", "Sun | \n", "Dinner | \n", "4 | \n", "
5 | \n", "25.29 | \n", "4.71 | \n", "Male | \n", "No | \n", "Sun | \n", "Dinner | \n", "4 | \n", "
6 | \n", "8.77 | \n", "2.00 | \n", "Male | \n", "No | \n", "Sun | \n", "Dinner | \n", "2 | \n", "
7 | \n", "26.88 | \n", "3.12 | \n", "Male | \n", "No | \n", "Sun | \n", "Dinner | \n", "4 | \n", "
8 | \n", "15.04 | \n", "1.96 | \n", "Male | \n", "No | \n", "Sun | \n", "Dinner | \n", "2 | \n", "
9 | \n", "14.78 | \n", "3.23 | \n", "Male | \n", "No | \n", "Sun | \n", "Dinner | \n", "2 | \n", "
10 | \n", "10.27 | \n", "1.71 | \n", "Male | \n", "No | \n", "Sun | \n", "Dinner | \n", "2 | \n", "
11 | \n", "35.26 | \n", "5.00 | \n", "Female | \n", "No | \n", "Sun | \n", "Dinner | \n", "4 | \n", "
12 | \n", "15.42 | \n", "1.57 | \n", "Male | \n", "No | \n", "Sun | \n", "Dinner | \n", "2 | \n", "
13 | \n", "18.43 | \n", "3.00 | \n", "Male | \n", "No | \n", "Sun | \n", "Dinner | \n", "4 | \n", "
14 | \n", "14.83 | \n", "3.02 | \n", "Female | \n", "No | \n", "Sun | \n", "Dinner | \n", "2 | \n", "
15 | \n", "21.58 | \n", "3.92 | \n", "Male | \n", "No | \n", "Sun | \n", "Dinner | \n", "2 | \n", "
16 | \n", "10.33 | \n", "1.67 | \n", "Female | \n", "No | \n", "Sun | \n", "Dinner | \n", "3 | \n", "
17 | \n", "16.29 | \n", "3.71 | \n", "Male | \n", "No | \n", "Sun | \n", "Dinner | \n", "3 | \n", "
18 | \n", "16.97 | \n", "3.50 | \n", "Female | \n", "No | \n", "Sun | \n", "Dinner | \n", "3 | \n", "
19 | \n", "20.65 | \n", "3.35 | \n", "Male | \n", "No | \n", "Sat | \n", "Dinner | \n", "3 | \n", "
20 | \n", "17.92 | \n", "4.08 | \n", "Male | \n", "No | \n", "Sat | \n", "Dinner | \n", "2 | \n", "
21 | \n", "20.29 | \n", "2.75 | \n", "Female | \n", "No | \n", "Sat | \n", "Dinner | \n", "2 | \n", "
22 | \n", "15.77 | \n", "2.23 | \n", "Female | \n", "No | \n", "Sat | \n", "Dinner | \n", "2 | \n", "
23 | \n", "39.42 | \n", "7.58 | \n", "Male | \n", "No | \n", "Sat | \n", "Dinner | \n", "4 | \n", "
24 | \n", "19.82 | \n", "3.18 | \n", "Male | \n", "No | \n", "Sat | \n", "Dinner | \n", "2 | \n", "
25 | \n", "17.81 | \n", "2.34 | \n", "Male | \n", "No | \n", "Sat | \n", "Dinner | \n", "4 | \n", "
26 | \n", "13.37 | \n", "2.00 | \n", "Male | \n", "No | \n", "Sat | \n", "Dinner | \n", "2 | \n", "
27 | \n", "12.69 | \n", "2.00 | \n", "Male | \n", "No | \n", "Sat | \n", "Dinner | \n", "2 | \n", "
28 | \n", "21.70 | \n", "4.30 | \n", "Male | \n", "No | \n", "Sat | \n", "Dinner | \n", "2 | \n", "
29 | \n", "19.65 | \n", "3.00 | \n", "Female | \n", "No | \n", "Sat | \n", "Dinner | \n", "2 | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
214 | \n", "28.17 | \n", "6.50 | \n", "Female | \n", "Yes | \n", "Sat | \n", "Dinner | \n", "3 | \n", "
215 | \n", "12.90 | \n", "1.10 | \n", "Female | \n", "Yes | \n", "Sat | \n", "Dinner | \n", "2 | \n", "
216 | \n", "28.15 | \n", "3.00 | \n", "Male | \n", "Yes | \n", "Sat | \n", "Dinner | \n", "5 | \n", "
217 | \n", "11.59 | \n", "1.50 | \n", "Male | \n", "Yes | \n", "Sat | \n", "Dinner | \n", "2 | \n", "
218 | \n", "7.74 | \n", "1.44 | \n", "Male | \n", "Yes | \n", "Sat | \n", "Dinner | \n", "2 | \n", "
219 | \n", "30.14 | \n", "3.09 | \n", "Female | \n", "Yes | \n", "Sat | \n", "Dinner | \n", "4 | \n", "
220 | \n", "12.16 | \n", "2.20 | \n", "Male | \n", "Yes | \n", "Fri | \n", "Lunch | \n", "2 | \n", "
221 | \n", "13.42 | \n", "3.48 | \n", "Female | \n", "Yes | \n", "Fri | \n", "Lunch | \n", "2 | \n", "
222 | \n", "8.58 | \n", "1.92 | \n", "Male | \n", "Yes | \n", "Fri | \n", "Lunch | \n", "1 | \n", "
223 | \n", "15.98 | \n", "3.00 | \n", "Female | \n", "No | \n", "Fri | \n", "Lunch | \n", "3 | \n", "
224 | \n", "13.42 | \n", "1.58 | \n", "Male | \n", "Yes | \n", "Fri | \n", "Lunch | \n", "2 | \n", "
225 | \n", "16.27 | \n", "2.50 | \n", "Female | \n", "Yes | \n", "Fri | \n", "Lunch | \n", "2 | \n", "
226 | \n", "10.09 | \n", "2.00 | \n", "Female | \n", "Yes | \n", "Fri | \n", "Lunch | \n", "2 | \n", "
227 | \n", "20.45 | \n", "3.00 | \n", "Male | \n", "No | \n", "Sat | \n", "Dinner | \n", "4 | \n", "
228 | \n", "13.28 | \n", "2.72 | \n", "Male | \n", "No | \n", "Sat | \n", "Dinner | \n", "2 | \n", "
229 | \n", "22.12 | \n", "2.88 | \n", "Female | \n", "Yes | \n", "Sat | \n", "Dinner | \n", "2 | \n", "
230 | \n", "24.01 | \n", "2.00 | \n", "Male | \n", "Yes | \n", "Sat | \n", "Dinner | \n", "4 | \n", "
231 | \n", "15.69 | \n", "3.00 | \n", "Male | \n", "Yes | \n", "Sat | \n", "Dinner | \n", "3 | \n", "
232 | \n", "11.61 | \n", "3.39 | \n", "Male | \n", "No | \n", "Sat | \n", "Dinner | \n", "2 | \n", "
233 | \n", "10.77 | \n", "1.47 | \n", "Male | \n", "No | \n", "Sat | \n", "Dinner | \n", "2 | \n", "
234 | \n", "15.53 | \n", "3.00 | \n", "Male | \n", "Yes | \n", "Sat | \n", "Dinner | \n", "2 | \n", "
235 | \n", "10.07 | \n", "1.25 | \n", "Male | \n", "No | \n", "Sat | \n", "Dinner | \n", "2 | \n", "
236 | \n", "12.60 | \n", "1.00 | \n", "Male | \n", "Yes | \n", "Sat | \n", "Dinner | \n", "2 | \n", "
237 | \n", "32.83 | \n", "1.17 | \n", "Male | \n", "Yes | \n", "Sat | \n", "Dinner | \n", "2 | \n", "
238 | \n", "35.83 | \n", "4.67 | \n", "Female | \n", "No | \n", "Sat | \n", "Dinner | \n", "3 | \n", "
239 | \n", "29.03 | \n", "5.92 | \n", "Male | \n", "No | \n", "Sat | \n", "Dinner | \n", "3 | \n", "
240 | \n", "27.18 | \n", "2.00 | \n", "Female | \n", "Yes | \n", "Sat | \n", "Dinner | \n", "2 | \n", "
241 | \n", "22.67 | \n", "2.00 | \n", "Male | \n", "Yes | \n", "Sat | \n", "Dinner | \n", "2 | \n", "
242 | \n", "17.82 | \n", "1.75 | \n", "Male | \n", "No | \n", "Sat | \n", "Dinner | \n", "2 | \n", "
243 | \n", "18.78 | \n", "3.00 | \n", "Female | \n", "No | \n", "Thur | \n", "Dinner | \n", "2 | \n", "
244 rows × 7 columns
\n", "