IPython notebook (precursor of Jupyter notebook) is a powerful tool for authoring dynamic document in Python, which combines code, formatted text, math, and multimedia in a single document.
Jupyter is the current development that emcompasses multiple languages including Julia, Python, and R.
In this course, you are required to write your homework reports using Jupyter Lab.
You can use Julia in Jupyter notebook through the IJulia.jl package.
For each homework, you need to submit your notebook (.e.g, hw1.ipynb
), html (e.g., hw1.html
), along with all code and data that are necessary to reproduce the results.
You can start with this notebook file.
Anaconda is a distribution of the Python and R programming languages for scientific computing, that aims to simplify package management and deployment. The distribution includes data-science packages suitable for Windows, Linux, and macOS. [Wikipedia]
Go to https://www.anaconda.com/products/individual and clike "Download" to install the Anaconda.
From Anaconda Navigator, use can launch Jupyter Lab.
Install IJulia from the Julia REPL by pressing ] to enter pkg mode and entering:
add IJulia
If you already have Jupyter installed on your machine, this process will also install a kernel specification that tells Jupyter how to launch Julia.
Useful to know some keyboard shortcuts. I frequently use
shift + return
: execute current cell.b
: create a cell below current cell.a
: create a cell above current cell.y
: change cell to code.m
: change cell to Markdown.Check more shortcuts in menu Help
-> Keyboard Shortcuts
.
Notebook can be converted to other formats such as html, LaTeX, Markdown, Julia code, and many others, via menu File
-> Download as
.
Mathematical formula can can be typeset as LaTeX in Markdown cells. For example, inline math: $e^{i \pi} + 1 = 0$ and displayed math
For multiline displayed math: \begin{eqnarray*} e^x &=& \sum_{i=0}^\infty \frac{1}{i!} x^i \\ &\approx& 1 + x + \frac{x^2}{2}. \end{eqnarray*}
This lecture note has evolved from Dr. Hua Zhou's 2019 Spring Statistical Computing course notes available at http://hua-zhou.github.io/teaching/biostatm280-2019spring/index.html.