Skip to content

Commit ab2305b

Browse files
authored
Merge pull request #8 from gjbex/development
Add examples
2 parents 5caa1a3 + c74f343 commit ab2305b

18 files changed

+160899
-31
lines changed

python_for_data_science.pptx

186 KB
Binary file not shown.

source-code/pandas/indexing_and_querying.ipynb

Lines changed: 2430 additions & 0 deletions
Large diffs are not rendered by default.

source-code/pandas/missing_values.ipynb

Lines changed: 110 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"# Missing data"
7+
"# Requirements"
88
]
99
},
1010
{
1111
"cell_type": "code",
12-
"execution_count": 9,
12+
"execution_count": 2,
1313
"metadata": {},
1414
"outputs": [],
1515
"source": [
@@ -28,7 +28,7 @@
2828
"cell_type": "markdown",
2929
"metadata": {},
3030
"source": [
31-
"## Representing missing values"
31+
"# Representing missing values"
3232
]
3333
},
3434
{
@@ -40,7 +40,7 @@
4040
},
4141
{
4242
"cell_type": "code",
43-
"execution_count": 32,
43+
"execution_count": 3,
4444
"metadata": {},
4545
"outputs": [],
4646
"source": [
@@ -49,7 +49,7 @@
4949
},
5050
{
5151
"cell_type": "code",
52-
"execution_count": 16,
52+
"execution_count": 4,
5353
"metadata": {},
5454
"outputs": [
5555
{
@@ -90,7 +90,7 @@
9090
},
9191
{
9292
"cell_type": "code",
93-
"execution_count": 24,
93+
"execution_count": 5,
9494
"metadata": {},
9595
"outputs": [],
9696
"source": [
@@ -103,7 +103,7 @@
103103
},
104104
{
105105
"cell_type": "code",
106-
"execution_count": 25,
106+
"execution_count": 6,
107107
"metadata": {},
108108
"outputs": [
109109
{
@@ -130,7 +130,7 @@
130130
},
131131
{
132132
"cell_type": "code",
133-
"execution_count": 26,
133+
"execution_count": 7,
134134
"metadata": {},
135135
"outputs": [
136136
{
@@ -249,7 +249,7 @@
249249
"9 37 7.7 B <NA>"
250250
]
251251
},
252-
"execution_count": 26,
252+
"execution_count": 7,
253253
"metadata": {},
254254
"output_type": "execute_result"
255255
}
@@ -269,7 +269,7 @@
269269
"cell_type": "markdown",
270270
"metadata": {},
271271
"source": [
272-
"## Computing and missing values"
272+
"# Computing and missing values"
273273
]
274274
},
275275
{
@@ -281,7 +281,7 @@
281281
},
282282
{
283283
"cell_type": "code",
284-
"execution_count": 27,
284+
"execution_count": 8,
285285
"metadata": {},
286286
"outputs": [
287287
{
@@ -290,7 +290,7 @@
290290
"165"
291291
]
292292
},
293-
"execution_count": 27,
293+
"execution_count": 8,
294294
"metadata": {},
295295
"output_type": "execute_result"
296296
}
@@ -301,7 +301,7 @@
301301
},
302302
{
303303
"cell_type": "code",
304-
"execution_count": 28,
304+
"execution_count": 9,
305305
"metadata": {},
306306
"outputs": [
307307
{
@@ -310,7 +310,7 @@
310310
"49.3"
311311
]
312312
},
313-
"execution_count": 28,
313+
"execution_count": 9,
314314
"metadata": {},
315315
"output_type": "execute_result"
316316
}
@@ -321,7 +321,7 @@
321321
},
322322
{
323323
"cell_type": "code",
324-
"execution_count": 29,
324+
"execution_count": 10,
325325
"metadata": {},
326326
"outputs": [
327327
{
@@ -406,7 +406,7 @@
406406
"max 37.000000 7.700000"
407407
]
408408
},
409-
"execution_count": 29,
409+
"execution_count": 10,
410410
"metadata": {},
411411
"output_type": "execute_result"
412412
}
@@ -424,7 +424,7 @@
424424
},
425425
{
426426
"cell_type": "code",
427-
"execution_count": 31,
427+
"execution_count": 11,
428428
"metadata": {},
429429
"outputs": [
430430
{
@@ -466,7 +466,7 @@
466466
" <tr>\n",
467467
" <th>top</th>\n",
468468
" <td>A</td>\n",
469-
" <td>str1_str1</td>\n",
469+
" <td>str1</td>\n",
470470
" </tr>\n",
471471
" <tr>\n",
472472
" <th>freq</th>\n",
@@ -481,11 +481,11 @@
481481
" category_data string_data\n",
482482
"count 9 9\n",
483483
"unique 2 9\n",
484-
"top A str1_str1\n",
484+
"top A str1\n",
485485
"freq 5 1"
486486
]
487487
},
488-
"execution_count": 31,
488+
"execution_count": 11,
489489
"metadata": {},
490490
"output_type": "execute_result"
491491
}
@@ -496,7 +496,7 @@
496496
},
497497
{
498498
"cell_type": "code",
499-
"execution_count": 39,
499+
"execution_count": 12,
500500
"metadata": {},
501501
"outputs": [
502502
{
@@ -547,7 +547,7 @@
547547
"B 3"
548548
]
549549
},
550-
"execution_count": 39,
550+
"execution_count": 12,
551551
"metadata": {},
552552
"output_type": "execute_result"
553553
}
@@ -558,12 +558,94 @@
558558
" .count()"
559559
]
560560
},
561+
{
562+
"cell_type": "markdown",
563+
"metadata": {},
564+
"source": [
565+
"# Selecting rows with missing data"
566+
]
567+
},
561568
{
562569
"cell_type": "code",
563-
"execution_count": null,
570+
"execution_count": 16,
564571
"metadata": {},
565-
"outputs": [],
566-
"source": []
572+
"outputs": [
573+
{
574+
"data": {
575+
"text/html": [
576+
"<div>\n",
577+
"<style scoped>\n",
578+
" .dataframe tbody tr th:only-of-type {\n",
579+
" vertical-align: middle;\n",
580+
" }\n",
581+
"\n",
582+
" .dataframe tbody tr th {\n",
583+
" vertical-align: top;\n",
584+
" }\n",
585+
"\n",
586+
" .dataframe thead th {\n",
587+
" text-align: right;\n",
588+
" }\n",
589+
"</style>\n",
590+
"<table border=\"1\" class=\"dataframe\">\n",
591+
" <thead>\n",
592+
" <tr style=\"text-align: right;\">\n",
593+
" <th></th>\n",
594+
" <th>int_data</th>\n",
595+
" <th>float_data</th>\n",
596+
" <th>category_data</th>\n",
597+
" <th>string_data</th>\n",
598+
" </tr>\n",
599+
" </thead>\n",
600+
" <tbody>\n",
601+
" <tr>\n",
602+
" <th>6</th>\n",
603+
" <td>&lt;NA&gt;</td>\n",
604+
" <td>5.5</td>\n",
605+
" <td>A</td>\n",
606+
" <td>str3</td>\n",
607+
" </tr>\n",
608+
" <tr>\n",
609+
" <th>7</th>\n",
610+
" <td>29</td>\n",
611+
" <td>NaN</td>\n",
612+
" <td>B</td>\n",
613+
" <td>str3_str1</td>\n",
614+
" </tr>\n",
615+
" <tr>\n",
616+
" <th>8</th>\n",
617+
" <td>31</td>\n",
618+
" <td>3.3</td>\n",
619+
" <td>NaN</td>\n",
620+
" <td>str2_str3</td>\n",
621+
" </tr>\n",
622+
" <tr>\n",
623+
" <th>9</th>\n",
624+
" <td>37</td>\n",
625+
" <td>7.7</td>\n",
626+
" <td>B</td>\n",
627+
" <td>&lt;NA&gt;</td>\n",
628+
" </tr>\n",
629+
" </tbody>\n",
630+
"</table>\n",
631+
"</div>"
632+
],
633+
"text/plain": [
634+
" int_data float_data category_data string_data\n",
635+
"6 <NA> 5.5 A str3\n",
636+
"7 29 NaN B str3_str1\n",
637+
"8 31 3.3 NaN str2_str3\n",
638+
"9 37 7.7 B <NA>"
639+
]
640+
},
641+
"execution_count": 16,
642+
"metadata": {},
643+
"output_type": "execute_result"
644+
}
645+
],
646+
"source": [
647+
"data2[data2.isnull().any(axis=1)]"
648+
]
567649
}
568650
],
569651
"metadata": {
@@ -582,8 +664,9 @@
582664
"name": "python",
583665
"nbconvert_exporter": "python",
584666
"pygments_lexer": "ipython3",
585-
"version": "3.7.6"
586-
}
667+
"version": "3.7.7"
668+
},
669+
"toc-autonumbering": true
587670
},
588671
"nbformat": 4,
589672
"nbformat_minor": 4

source-code/panel/.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
11
get_data.sh
2-
school_tool.ipynb
3-
Schooltool-latest.xlsx
665 KB
Binary file not shown.

0 commit comments

Comments
 (0)