Skip to content

Commit 8ba615c

Browse files
committed
exercise question for part 1
1 parent 5fc49b5 commit 8ba615c

File tree

2 files changed

+4440
-5121
lines changed

2 files changed

+4440
-5121
lines changed

exercises/Untitled.ipynb

Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"# Part 1 -- Intro"
8+
]
9+
},
10+
{
11+
"cell_type": "markdown",
12+
"metadata": {},
13+
"source": [
14+
"Load the tips dataset from seaborn"
15+
]
16+
},
17+
{
18+
"cell_type": "code",
19+
"execution_count": 3,
20+
"metadata": {},
21+
"outputs": [
22+
{
23+
"data": {
24+
"text/html": [
25+
"<div>\n",
26+
"<style scoped>\n",
27+
" .dataframe tbody tr th:only-of-type {\n",
28+
" vertical-align: middle;\n",
29+
" }\n",
30+
"\n",
31+
" .dataframe tbody tr th {\n",
32+
" vertical-align: top;\n",
33+
" }\n",
34+
"\n",
35+
" .dataframe thead th {\n",
36+
" text-align: right;\n",
37+
" }\n",
38+
"</style>\n",
39+
"<table border=\"1\" class=\"dataframe\">\n",
40+
" <thead>\n",
41+
" <tr style=\"text-align: right;\">\n",
42+
" <th></th>\n",
43+
" <th>total_bill</th>\n",
44+
" <th>tip</th>\n",
45+
" <th>sex</th>\n",
46+
" <th>smoker</th>\n",
47+
" <th>day</th>\n",
48+
" <th>time</th>\n",
49+
" <th>size</th>\n",
50+
" </tr>\n",
51+
" </thead>\n",
52+
" <tbody>\n",
53+
" <tr>\n",
54+
" <th>0</th>\n",
55+
" <td>16.99</td>\n",
56+
" <td>1.01</td>\n",
57+
" <td>Female</td>\n",
58+
" <td>No</td>\n",
59+
" <td>Sun</td>\n",
60+
" <td>Dinner</td>\n",
61+
" <td>2</td>\n",
62+
" </tr>\n",
63+
" <tr>\n",
64+
" <th>1</th>\n",
65+
" <td>10.34</td>\n",
66+
" <td>1.66</td>\n",
67+
" <td>Male</td>\n",
68+
" <td>No</td>\n",
69+
" <td>Sun</td>\n",
70+
" <td>Dinner</td>\n",
71+
" <td>3</td>\n",
72+
" </tr>\n",
73+
" <tr>\n",
74+
" <th>2</th>\n",
75+
" <td>21.01</td>\n",
76+
" <td>3.50</td>\n",
77+
" <td>Male</td>\n",
78+
" <td>No</td>\n",
79+
" <td>Sun</td>\n",
80+
" <td>Dinner</td>\n",
81+
" <td>3</td>\n",
82+
" </tr>\n",
83+
" <tr>\n",
84+
" <th>3</th>\n",
85+
" <td>23.68</td>\n",
86+
" <td>3.31</td>\n",
87+
" <td>Male</td>\n",
88+
" <td>No</td>\n",
89+
" <td>Sun</td>\n",
90+
" <td>Dinner</td>\n",
91+
" <td>2</td>\n",
92+
" </tr>\n",
93+
" <tr>\n",
94+
" <th>4</th>\n",
95+
" <td>24.59</td>\n",
96+
" <td>3.61</td>\n",
97+
" <td>Female</td>\n",
98+
" <td>No</td>\n",
99+
" <td>Sun</td>\n",
100+
" <td>Dinner</td>\n",
101+
" <td>4</td>\n",
102+
" </tr>\n",
103+
" </tbody>\n",
104+
"</table>\n",
105+
"</div>"
106+
],
107+
"text/plain": [
108+
" total_bill tip sex smoker day time size\n",
109+
"0 16.99 1.01 Female No Sun Dinner 2\n",
110+
"1 10.34 1.66 Male No Sun Dinner 3\n",
111+
"2 21.01 3.50 Male No Sun Dinner 3\n",
112+
"3 23.68 3.31 Male No Sun Dinner 2\n",
113+
"4 24.59 3.61 Female No Sun Dinner 4"
114+
]
115+
},
116+
"execution_count": 3,
117+
"metadata": {},
118+
"output_type": "execute_result"
119+
}
120+
],
121+
"source": [
122+
"import seaborn as sns\n",
123+
"\n",
124+
"tips = sns.load_dataset('tips')\n",
125+
"tips.head()"
126+
]
127+
},
128+
{
129+
"cell_type": "markdown",
130+
"metadata": {},
131+
"source": [
132+
"### Filter rows by `smoker == 'No'` and `total_bill >= 10`"
133+
]
134+
},
135+
{
136+
"cell_type": "code",
137+
"execution_count": null,
138+
"metadata": {},
139+
"outputs": [],
140+
"source": []
141+
},
142+
{
143+
"cell_type": "markdown",
144+
"metadata": {},
145+
"source": [
146+
"### What is the average `total_bill` for each value of `smoker`, `day`, and `time`"
147+
]
148+
},
149+
{
150+
"cell_type": "code",
151+
"execution_count": null,
152+
"metadata": {},
153+
"outputs": [],
154+
"source": []
155+
},
156+
{
157+
"cell_type": "markdown",
158+
"metadata": {},
159+
"source": [
160+
"# Part 2 -- Tidy"
161+
]
162+
},
163+
{
164+
"cell_type": "code",
165+
"execution_count": null,
166+
"metadata": {},
167+
"outputs": [],
168+
"source": []
169+
}
170+
],
171+
"metadata": {
172+
"kernelspec": {
173+
"display_name": "Python 3",
174+
"language": "python",
175+
"name": "python3"
176+
},
177+
"language_info": {
178+
"codemirror_mode": {
179+
"name": "ipython",
180+
"version": 3
181+
},
182+
"file_extension": ".py",
183+
"mimetype": "text/x-python",
184+
"name": "python",
185+
"nbconvert_exporter": "python",
186+
"pygments_lexer": "ipython3",
187+
"version": "3.7.3"
188+
}
189+
},
190+
"nbformat": 4,
191+
"nbformat_minor": 2
192+
}

0 commit comments

Comments
 (0)