|
325 | 325 | { |
326 | 326 | "cell_type": "markdown", |
327 | 327 | "metadata": { |
328 | | - "collapsed": true, |
329 | 328 | "slideshow": { |
330 | 329 | "slide_type": "slide" |
331 | 330 | } |
|
349 | 348 | { |
350 | 349 | "cell_type": "markdown", |
351 | 350 | "metadata": { |
352 | | - "collapsed": true, |
353 | 351 | "slideshow": { |
354 | 352 | "slide_type": "fragment" |
355 | 353 | } |
|
430 | 428 | { |
431 | 429 | "cell_type": "markdown", |
432 | 430 | "metadata": { |
433 | | - "collapsed": true, |
434 | 431 | "slideshow": { |
435 | 432 | "slide_type": "subslide" |
436 | 433 | } |
|
508 | 505 | "slide_type": "fragment" |
509 | 506 | } |
510 | 507 | }, |
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 | + ], |
512 | 529 | "source": [ |
513 | 530 | "# An alternative is to put a question mark behind the command\n", |
514 | 531 | "os.mkdir?" |
|
539 | 556 | "slide_type": "fragment" |
540 | 557 | } |
541 | 558 | }, |
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 | + ], |
543 | 585 | "source": [ |
544 | 586 | "import glob\n", |
545 | 587 | "glob.glob??" |
|
601 | 643 | } |
602 | 644 | }, |
603 | 645 | "source": [ |
604 | | - "## CTRL + SHIFT + P" |
| 646 | + "## CTRL + SHIFT + C" |
605 | 647 | ] |
606 | 648 | }, |
607 | 649 | { |
|
643 | 685 | "</div>" |
644 | 686 | ] |
645 | 687 | }, |
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 | | - }, |
672 | 688 | { |
673 | 689 | "cell_type": "markdown", |
674 | 690 | "metadata": { |
|
729 | 745 | }, |
730 | 746 | { |
731 | 747 | "cell_type": "code", |
732 | | - "execution_count": 11, |
| 748 | + "execution_count": 10, |
733 | 749 | "metadata": { |
734 | 750 | "run_control": { |
735 | 751 | "frozen": false, |
|
739 | 755 | "slide_type": "fragment" |
740 | 756 | } |
741 | 757 | }, |
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 | + ], |
743 | 776 | "source": [ |
744 | 777 | "%psearch os.*dir" |
745 | 778 | ] |
|
757 | 790 | }, |
758 | 791 | { |
759 | 792 | "cell_type": "code", |
760 | | - "execution_count": 12, |
| 793 | + "execution_count": 11, |
761 | 794 | "metadata": { |
762 | 795 | "run_control": { |
763 | 796 | "frozen": false, |
|
772 | 805 | "name": "stdout", |
773 | 806 | "output_type": "stream", |
774 | 807 | "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" |
776 | 809 | ] |
777 | 810 | } |
778 | 811 | ], |
|
786 | 819 | }, |
787 | 820 | { |
788 | 821 | "cell_type": "code", |
789 | | - "execution_count": 13, |
| 822 | + "execution_count": 12, |
790 | 823 | "metadata": { |
791 | 824 | "run_control": { |
792 | 825 | "frozen": false, |
|
803 | 836 | }, |
804 | 837 | { |
805 | 838 | "cell_type": "code", |
806 | | - "execution_count": 16, |
| 839 | + "execution_count": 13, |
807 | 840 | "metadata": { |
808 | 841 | "run_control": { |
809 | 842 | "frozen": false, |
|
818 | 851 | "name": "stdout", |
819 | 852 | "output_type": "stream", |
820 | 853 | "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" |
822 | 855 | ] |
823 | 856 | } |
824 | 857 | ], |
|
837 | 870 | }, |
838 | 871 | { |
839 | 872 | "cell_type": "code", |
840 | | - "execution_count": 17, |
| 873 | + "execution_count": 14, |
841 | 874 | "metadata": {}, |
842 | 875 | "outputs": [ |
843 | 876 | { |
|
848 | 881 | "------------------------------------------------\n", |
849 | 882 | "DS int 10\n", |
850 | 883 | "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", |
852 | 885 | "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" |
855 | 887 | ] |
856 | 888 | } |
857 | 889 | ], |
|
872 | 904 | }, |
873 | 905 | { |
874 | 906 | "cell_type": "code", |
875 | | - "execution_count": 18, |
| 907 | + "execution_count": 15, |
876 | 908 | "metadata": { |
877 | 909 | "run_control": { |
878 | 910 | "frozen": false, |
|
1025 | 1057 | "Automagic is ON, % prefix IS NOT needed for line magics." |
1026 | 1058 | ] |
1027 | 1059 | }, |
1028 | | - "execution_count": 18, |
| 1060 | + "execution_count": 15, |
1029 | 1061 | "metadata": {}, |
1030 | 1062 | "output_type": "execute_result" |
1031 | 1063 | } |
|
1047 | 1079 | }, |
1048 | 1080 | { |
1049 | 1081 | "cell_type": "code", |
1050 | | - "execution_count": 19, |
| 1082 | + "execution_count": 16, |
1051 | 1083 | "metadata": { |
1052 | 1084 | "run_control": { |
1053 | 1085 | "frozen": false, |
|
1064 | 1096 | }, |
1065 | 1097 | { |
1066 | 1098 | "cell_type": "code", |
1067 | | - "execution_count": 20, |
| 1099 | + "execution_count": 17, |
1068 | 1100 | "metadata": { |
1069 | 1101 | "run_control": { |
1070 | 1102 | "frozen": false, |
|
1079 | 1111 | "data": { |
1080 | 1112 | "text/html": [ |
1081 | 1113 | "./<br>\n", |
1082 | | - " <a href='./01-basic.ipynb' target='_blank'>01-basic.ipynb</a><br>\n", |
1083 | 1114 | " <a href='./python_rehearsal.ipynb' target='_blank'>python_rehearsal.ipynb</a><br>\n", |
1084 | | - " <a href='./03-functions.ipynb' target='_blank'>03-functions.ipynb</a><br>\n", |
1085 | 1115 | " <a href='./05-numpy.ipynb' target='_blank'>05-numpy.ipynb</a><br>\n", |
| 1116 | + " <a href='./03-functions.ipynb' target='_blank'>03-functions.ipynb</a><br>\n", |
1086 | 1117 | " <a href='./00-jupyter_introduction.ipynb' target='_blank'>00-jupyter_introduction.ipynb</a><br>\n", |
| 1118 | + " <a href='./01-basic.ipynb' target='_blank'>01-basic.ipynb</a><br>\n", |
1087 | 1119 | " <a href='./02-control_flow.ipynb' target='_blank'>02-control_flow.ipynb</a><br>\n", |
1088 | 1120 | " <a href='./04-reusing_code.ipynb' target='_blank'>04-reusing_code.ipynb</a><br>" |
1089 | 1121 | ], |
1090 | 1122 | "text/plain": [ |
1091 | 1123 | "./\n", |
1092 | | - " 01-basic.ipynb\n", |
1093 | 1124 | " python_rehearsal.ipynb\n", |
1094 | | - " 03-functions.ipynb\n", |
1095 | 1125 | " 05-numpy.ipynb\n", |
| 1126 | + " 03-functions.ipynb\n", |
1096 | 1127 | " 00-jupyter_introduction.ipynb\n", |
| 1128 | + " 01-basic.ipynb\n", |
1097 | 1129 | " 02-control_flow.ipynb\n", |
1098 | 1130 | " 04-reusing_code.ipynb" |
1099 | 1131 | ] |
1100 | 1132 | }, |
1101 | | - "execution_count": 20, |
| 1133 | + "execution_count": 17, |
1102 | 1134 | "metadata": {}, |
1103 | 1135 | "output_type": "execute_result" |
1104 | 1136 | } |
|
1137 | 1169 | "name": "python", |
1138 | 1170 | "nbconvert_exporter": "python", |
1139 | 1171 | "pygments_lexer": "ipython3", |
1140 | | - "version": "3.7.5" |
| 1172 | + "version": "3.8.10" |
1141 | 1173 | }, |
1142 | 1174 | "nav_menu": {}, |
1143 | 1175 | "toc": { |
|
1155 | 1187 | "right": "1568px", |
1156 | 1188 | "top": "106px", |
1157 | 1189 | "width": "301px" |
| 1190 | + }, |
| 1191 | + "widgets": { |
| 1192 | + "application/vnd.jupyter.widget-state+json": { |
| 1193 | + "state": {}, |
| 1194 | + "version_major": 2, |
| 1195 | + "version_minor": 0 |
| 1196 | + } |
1158 | 1197 | } |
1159 | 1198 | }, |
1160 | 1199 | "nbformat": 4, |
1161 | | - "nbformat_minor": 1 |
| 1200 | + "nbformat_minor": 4 |
1162 | 1201 | } |
0 commit comments