Skip to content

Commit f2d2089

Browse files
jorisvandenbosschestijnvanhoey
authored andcommitted
Update + move jupyter notebook
1 parent d1b865d commit f2d2089

File tree

1 file changed

+93
-54
lines changed

1 file changed

+93
-54
lines changed

_solved/python_recap/00-jupyter_introduction.ipynb renamed to _solved/00-jupyter_introduction.ipynb

Lines changed: 93 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,6 @@
325325
{
326326
"cell_type": "markdown",
327327
"metadata": {
328-
"collapsed": true,
329328
"slideshow": {
330329
"slide_type": "slide"
331330
}
@@ -349,7 +348,6 @@
349348
{
350349
"cell_type": "markdown",
351350
"metadata": {
352-
"collapsed": true,
353351
"slideshow": {
354352
"slide_type": "fragment"
355353
}
@@ -430,7 +428,6 @@
430428
{
431429
"cell_type": "markdown",
432430
"metadata": {
433-
"collapsed": true,
434431
"slideshow": {
435432
"slide_type": "subslide"
436433
}
@@ -508,7 +505,27 @@
508505
"slide_type": "fragment"
509506
}
510507
},
511-
"outputs": [],
508+
"outputs": [
509+
{
510+
"data": {
511+
"text/plain": [
512+
"\u001b[0;31mSignature:\u001b[0m \u001b[0mos\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmkdir\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mpath\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmode\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m511\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m*\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdir_fd\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mNone\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
513+
"\u001b[0;31mDocstring:\u001b[0m\n",
514+
"Create a directory.\n",
515+
"\n",
516+
"If dir_fd is not None, it should be a file descriptor open to a directory,\n",
517+
" and path should be relative; path will then be relative to that directory.\n",
518+
"dir_fd may not be implemented on your platform.\n",
519+
" If it is unavailable, using it will raise a NotImplementedError.\n",
520+
"\n",
521+
"The mode argument is ignored on Windows.\n",
522+
"\u001b[0;31mType:\u001b[0m builtin_function_or_method\n"
523+
]
524+
},
525+
"metadata": {},
526+
"output_type": "display_data"
527+
}
528+
],
512529
"source": [
513530
"# An alternative is to put a question mark behind the command\n",
514531
"os.mkdir?"
@@ -539,7 +556,32 @@
539556
"slide_type": "fragment"
540557
}
541558
},
542-
"outputs": [],
559+
"outputs": [
560+
{
561+
"data": {
562+
"text/plain": [
563+
"\u001b[0;31mSignature:\u001b[0m \u001b[0mglob\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mglob\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mpathname\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m*\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mrecursive\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mFalse\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
564+
"\u001b[0;31mSource:\u001b[0m \n",
565+
"\u001b[0;32mdef\u001b[0m \u001b[0mglob\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mpathname\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m*\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mrecursive\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mFalse\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\n",
566+
"\u001b[0;34m\u001b[0m \u001b[0;34m\"\"\"Return a list of paths matching a pathname pattern.\u001b[0m\n",
567+
"\u001b[0;34m\u001b[0m\n",
568+
"\u001b[0;34m The pattern may contain simple shell-style wildcards a la\u001b[0m\n",
569+
"\u001b[0;34m fnmatch. However, unlike fnmatch, filenames starting with a\u001b[0m\n",
570+
"\u001b[0;34m dot are special cases that are not matched by '*' and '?'\u001b[0m\n",
571+
"\u001b[0;34m patterns.\u001b[0m\n",
572+
"\u001b[0;34m\u001b[0m\n",
573+
"\u001b[0;34m If recursive is true, the pattern '**' will match any files and\u001b[0m\n",
574+
"\u001b[0;34m zero or more directories and subdirectories.\u001b[0m\n",
575+
"\u001b[0;34m \"\"\"\u001b[0m\u001b[0;34m\u001b[0m\n",
576+
"\u001b[0;34m\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mlist\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0miglob\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mpathname\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mrecursive\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mrecursive\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
577+
"\u001b[0;31mFile:\u001b[0m ~/miniconda3/envs/DS-python-data-analysis/lib/python3.8/glob.py\n",
578+
"\u001b[0;31mType:\u001b[0m function\n"
579+
]
580+
},
581+
"metadata": {},
582+
"output_type": "display_data"
583+
}
584+
],
543585
"source": [
544586
"import glob\n",
545587
"glob.glob??"
@@ -601,7 +643,7 @@
601643
}
602644
},
603645
"source": [
604-
"## CTRL + SHIFT + P"
646+
"## CTRL + SHIFT + C"
605647
]
606648
},
607649
{
@@ -643,32 +685,6 @@
643685
"</div>"
644686
]
645687
},
646-
{
647-
"cell_type": "markdown",
648-
"metadata": {
649-
"slideshow": {
650-
"slide_type": "slide"
651-
}
652-
},
653-
"source": [
654-
"## Overload?!?"
655-
]
656-
},
657-
{
658-
"cell_type": "markdown",
659-
"metadata": {
660-
"slideshow": {
661-
"slide_type": "subslide"
662-
}
663-
},
664-
"source": [
665-
"<img src=\"../../img/toomuch.jpg\" alt=\"Key A\" style=\"width:500px\">\n",
666-
"<br><br>\n",
667-
"<center>No stress, just go to </center>\n",
668-
"<br>\n",
669-
"<center><p style=\"font-size: 200%;text-align: center;margin:500\">`Help` > `Keyboard shortcuts`</p></center>"
670-
]
671-
},
672688
{
673689
"cell_type": "markdown",
674690
"metadata": {
@@ -729,7 +745,7 @@
729745
},
730746
{
731747
"cell_type": "code",
732-
"execution_count": 11,
748+
"execution_count": 10,
733749
"metadata": {
734750
"run_control": {
735751
"frozen": false,
@@ -739,7 +755,24 @@
739755
"slide_type": "fragment"
740756
}
741757
},
742-
"outputs": [],
758+
"outputs": [
759+
{
760+
"data": {
761+
"text/plain": [
762+
"os.chdir\n",
763+
"os.curdir\n",
764+
"os.fchdir\n",
765+
"os.listdir\n",
766+
"os.mkdir\n",
767+
"os.pardir\n",
768+
"os.rmdir\n",
769+
"os.scandir"
770+
]
771+
},
772+
"metadata": {},
773+
"output_type": "display_data"
774+
}
775+
],
743776
"source": [
744777
"%psearch os.*dir"
745778
]
@@ -757,7 +790,7 @@
757790
},
758791
{
759792
"cell_type": "code",
760-
"execution_count": 12,
793+
"execution_count": 11,
761794
"metadata": {
762795
"run_control": {
763796
"frozen": false,
@@ -772,7 +805,7 @@
772805
"name": "stdout",
773806
"output_type": "stream",
774807
"text": [
775-
"365 µs ± 16.8 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)\n"
808+
"159 µs ± 2.55 µs per loop (mean ± std. dev. of 7 runs, 10000 loops each)\n"
776809
]
777810
}
778811
],
@@ -786,7 +819,7 @@
786819
},
787820
{
788821
"cell_type": "code",
789-
"execution_count": 13,
822+
"execution_count": 12,
790823
"metadata": {
791824
"run_control": {
792825
"frozen": false,
@@ -803,7 +836,7 @@
803836
},
804837
{
805838
"cell_type": "code",
806-
"execution_count": 16,
839+
"execution_count": 13,
807840
"metadata": {
808841
"run_control": {
809842
"frozen": false,
@@ -818,7 +851,7 @@
818851
"name": "stdout",
819852
"output_type": "stream",
820853
"text": [
821-
"5.09 µs ± 99.3 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)\n"
854+
"2.42 µs ± 242 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)\n"
822855
]
823856
}
824857
],
@@ -837,7 +870,7 @@
837870
},
838871
{
839872
"cell_type": "code",
840-
"execution_count": 17,
873+
"execution_count": 14,
841874
"metadata": {},
842875
"outputs": [
843876
{
@@ -848,10 +881,9 @@
848881
"------------------------------------------------\n",
849882
"DS int 10\n",
850883
"Image type <class 'IPython.core.display.Image'>\n",
851-
"glob module <module 'glob' from '/hom<...>s/lib/python3.7/glob.py'>\n",
884+
"glob module <module 'glob' from '/hom<...>s/lib/python3.8/glob.py'>\n",
852885
"my_very_long_variable_name int 3\n",
853-
"np module <module 'numpy' from '/ho<...>kages/numpy/__init__.py'>\n",
854-
"os module <module 'os' from '/home/<...>sis/lib/python3.7/os.py'>\n"
886+
"os module <module 'os' from '/home/<...>sis/lib/python3.8/os.py'>\n"
855887
]
856888
}
857889
],
@@ -872,7 +904,7 @@
872904
},
873905
{
874906
"cell_type": "code",
875-
"execution_count": 18,
907+
"execution_count": 15,
876908
"metadata": {
877909
"run_control": {
878910
"frozen": false,
@@ -1025,7 +1057,7 @@
10251057
"Automagic is ON, % prefix IS NOT needed for line magics."
10261058
]
10271059
},
1028-
"execution_count": 18,
1060+
"execution_count": 15,
10291061
"metadata": {},
10301062
"output_type": "execute_result"
10311063
}
@@ -1047,7 +1079,7 @@
10471079
},
10481080
{
10491081
"cell_type": "code",
1050-
"execution_count": 19,
1082+
"execution_count": 16,
10511083
"metadata": {
10521084
"run_control": {
10531085
"frozen": false,
@@ -1064,7 +1096,7 @@
10641096
},
10651097
{
10661098
"cell_type": "code",
1067-
"execution_count": 20,
1099+
"execution_count": 17,
10681100
"metadata": {
10691101
"run_control": {
10701102
"frozen": false,
@@ -1079,26 +1111,26 @@
10791111
"data": {
10801112
"text/html": [
10811113
"./<br>\n",
1082-
"&nbsp;&nbsp;<a href='./01-basic.ipynb' target='_blank'>01-basic.ipynb</a><br>\n",
10831114
"&nbsp;&nbsp;<a href='./python_rehearsal.ipynb' target='_blank'>python_rehearsal.ipynb</a><br>\n",
1084-
"&nbsp;&nbsp;<a href='./03-functions.ipynb' target='_blank'>03-functions.ipynb</a><br>\n",
10851115
"&nbsp;&nbsp;<a href='./05-numpy.ipynb' target='_blank'>05-numpy.ipynb</a><br>\n",
1116+
"&nbsp;&nbsp;<a href='./03-functions.ipynb' target='_blank'>03-functions.ipynb</a><br>\n",
10861117
"&nbsp;&nbsp;<a href='./00-jupyter_introduction.ipynb' target='_blank'>00-jupyter_introduction.ipynb</a><br>\n",
1118+
"&nbsp;&nbsp;<a href='./01-basic.ipynb' target='_blank'>01-basic.ipynb</a><br>\n",
10871119
"&nbsp;&nbsp;<a href='./02-control_flow.ipynb' target='_blank'>02-control_flow.ipynb</a><br>\n",
10881120
"&nbsp;&nbsp;<a href='./04-reusing_code.ipynb' target='_blank'>04-reusing_code.ipynb</a><br>"
10891121
],
10901122
"text/plain": [
10911123
"./\n",
1092-
" 01-basic.ipynb\n",
10931124
" python_rehearsal.ipynb\n",
1094-
" 03-functions.ipynb\n",
10951125
" 05-numpy.ipynb\n",
1126+
" 03-functions.ipynb\n",
10961127
" 00-jupyter_introduction.ipynb\n",
1128+
" 01-basic.ipynb\n",
10971129
" 02-control_flow.ipynb\n",
10981130
" 04-reusing_code.ipynb"
10991131
]
11001132
},
1101-
"execution_count": 20,
1133+
"execution_count": 17,
11021134
"metadata": {},
11031135
"output_type": "execute_result"
11041136
}
@@ -1137,7 +1169,7 @@
11371169
"name": "python",
11381170
"nbconvert_exporter": "python",
11391171
"pygments_lexer": "ipython3",
1140-
"version": "3.7.5"
1172+
"version": "3.8.10"
11411173
},
11421174
"nav_menu": {},
11431175
"toc": {
@@ -1155,8 +1187,15 @@
11551187
"right": "1568px",
11561188
"top": "106px",
11571189
"width": "301px"
1190+
},
1191+
"widgets": {
1192+
"application/vnd.jupyter.widget-state+json": {
1193+
"state": {},
1194+
"version_major": 2,
1195+
"version_minor": 0
1196+
}
11581197
}
11591198
},
11601199
"nbformat": 4,
1161-
"nbformat_minor": 1
1200+
"nbformat_minor": 4
11621201
}

0 commit comments

Comments
 (0)