Introduction to Jupyter¶
History and Status¶
Jupyter and the future of IPython https://ipython.org/ https://en.wikipedia.org/wiki/IPython
Installation¶
Basically, Download Continuum Anaconda http://jupyter-notebook-beginner-guide.readthedocs.io/en/latest/install.html
Once you have conda, you may install “R Essentials” into the current environment:
conda install -c r r-essentials
Notebook¶
Here are some common usage:
keyboard shortcut: https://sowingseasons.com/blog/reference/2016/01/jupyter-keyboard-shortcuts/23298516
Inspect data files:
!head -n 5 filename.extload, save, run file
%load file.py %%writefile myfile.py %run myfile.pytime the execution:
%timeit range(1000) %%timeit x = range(10000) ...: max(x) ...:for more magic and help:
%lsmagic %COMMAND-NAME?display html:
from IPython.core.display import display, HTML display(HTML('<h1>Hello, world!</h1>'))display image:
from IPython.display import Image, display display(Image(filename='test.png'))display video:
from IPython.display import YouTubeVideo YouTubeVideo('sjfsUzECqK0')create javascript:
from IPython.display import Javascript Javascript(""" $.getScript('http://d3js.org/d3.v3.min.js') """)