<jupyter_start><jupyter_text>Jupyter Notebook Commands  Command Mode (esc)  edit mode() - ctrl + enter    = run & stay on current line- alt + enter     = run & create new line- shift + enter   = run & move to next line- tab             = auto-complete- shift + tab     = show information- ? + run         = show information- shit + alt      = move by word  Magic Command (%) only operates within ipython jupyter notebook **%pwd : shows the current path**<jupyter_code>%pwd<jupyter_output><empty_output><jupyter_text>**%ls : shows contents in current directory**<jupyter_code>%ls<jupyter_output>[31m01_python&jupyternotebook.ipynb[m[m*   [31m06_module_package.ipynb[m[m*
[31m02_basic_syntax.ipynb[m[m*             [31m07_try_except.ipynb[m[m*
[31m03_condition_loop_input.ipynb[m[m*     [31m08_file.ipynb[m[m*
[31m04_function.ipynb[m[m*                 20180108_01.Jupyternotebook.ipynb
[31m05_class.ipynb[m[m*<jupyter_text>**%whos : shows list of variables, functions etc**<jupyter_code>def sum(a, b):
    return a + b
%whos<jupyter_output>Variable   Type        Data/Info
--------------------------------
sum        function    <function sum at 0x106551510><jupyter_text>**%reset : reset or clear all current functions, variables**<jupyter_code>%reset
%whos<jupyter_output>Interactive namespace is empty.<jupyter_text>**%%time : shows calculated running time** **%%timeit : shows time analysis on multiple runs**<jupyter_code>%%time
1+3
%%timeit
(1+3)<jupyter_output>16.8 ns ± 0.482 ns per loop (mean ± std. dev. of 7 runs, 100000000 loops each)<jupyter_text>**%%writefile : creates file, or overwrite if already exists** **%loadfile : load the file****%run : run the file****%lsmagic : shows all list of magic keywords** **%history : shows all history of run**<jupyter_code>%%writefile test.py
%%load test.py
%run test.py
%lsmagic
%history<jupyter_output>%pwd
%ls
def sum(a, b):
    return a + b
%whos
%reset
%whos
%%time
1+3
%%timeit
(1+3)
%lsmagic
%history<jupyter_text>Shell Command (!) basic shell command : also applicable on git, bash, terminal ...- Korean description```- ls : shows list of files in the current directory- echo : return name of the files- touch : create file- cat : print out file content- mkdir : create directory (... or folder if it sounds unfamiliar)- rmdir : remove, delete directory- mv : move file (or overite- cp : copy file- rm : remove file- df : (disk free) check disk usage``` **! ls : shows list of files in current directory**<jupyter_code>! ls<jupyter_output>[31m01_python&jupyternotebook.ipynb[m[m   [31m06_module_package.ipynb[m[m
[31m02_basic_syntax.ipynb[m[m             [31m07_try_except.ipynb[m[m
[31m03_condition_loop_input.ipynb[m[m     [31m08_file.ipynb[m[m
[31m04_function.ipynb[m[m                 20180108_01.Jupyternotebook.ipynb
[31m05_class.ipynb[m[m<jupyter_text>**! touch __ : create file**<jupyter_code>! touch test.py  # creating file
file_list = ! ls
file_list<jupyter_output><empty_output><jupyter_text>**! echo : print out the list**<jupyter_code>! echo {file_list}<jupyter_output>[01_python&jupyternotebook.ipynb, 02_basic_syntax.ipynb, 03_condition_loop_input.ipynb, 04_function.ipynb, 05_class.ipynb, 06_module_package.ipynb, 07_try_except.ipynb, 08_file.ipynb, 20180108_01.Jupyternotebook.ipynb]<jupyter_text>**! cat (): shows inside contents in file**<jupyter_code>! cat test.py<jupyter_output><empty_output><jupyter_text>**! mkdir __ : create new directory**<jupyter_code>! mkdir python<jupyter_output><empty_output><jupyter_text>**! rmdir python : remove directory**<jupyter_code>! rmdir<jupyter_output><empty_output><jupyter_text>**! cp (_1_)  (_2_) : copy (1) as (2)**<jupyter_code>! cp test.py test2 py<jupyter_output><empty_output><jupyter_text>**! rm () : remove file**<jupyter_code>! rm test.py<jupyter_output><empty_output><jupyter_text>**! df -h : shows current status of my device**<jupyter_code>! df -h<jupyter_output>Filesystem      Size   Used  Avail Capacity iused               ifree %iused  Mounted on
/dev/disk1s1   186Gi  123Gi   58Gi    68% 1285558 9223372036853490249    0%   /
devfs          186Ki  186Ki    0Bi   100%     642                   0  100%   /dev
/dev/disk1s4   186Gi  3.0Gi   58Gi     5%       3 9223372036854775804    0%   /private/var/vm
map -hosts       0Bi    0Bi    0Bi   100%       0                   0  100%   /net
map auto_home    0Bi    0Bi    0Bi   100%       0                   0  100%   /home
/dev/disk0s3    47Gi   25Gi   23Gi    52%  132192            23865060    1%   /Volumes/BOOTCAMP
{'fraction_non_alphanumeric': 0.13378585504707685, 'fraction_numerical': 0.06218524195314211, 'mean_word_length': 3.906552094522019, 'pattern_counts': {'":': 0, '<': 54, '<?xml version=': 0, '>': 54, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 1, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '15', 'dir': 'jupyter-structured-clean-dedup', 'id': '442776', 'license': 'MIT', 'n_tokens_mistral': 1927, 'n_tokens_neox': 1695, 'n_words': 394, 'path': '1_python/fastcampus_dss_lectures/00_jupyternotebook_basic.ipynb', 'repo_name': 'lucaseo/TIL', 'size': '4567'}