Jupyter Notebooks FAQ

Jupyter notebooks provide an opportunity to share not only executable code but also provide context about the code and the techniques used.

Jupyter notebooks provide an opportunity to share not only executable code but also provide context about the code and the techniques used. Typically, scripts written in a language such as Stata, R, or Python have comments that may provide basic explanation of the analysis techniques or logic behind the elements of the scripts. However, by necessity they are usually brief and provide little insight into the techniques used. Jupyter notebooks were developed to address some of the limitations that exist with traditional scripting by making it possible to execute code, see results, and document the work all in one easily read document.

What are Jupyter notebooks?

Jupyter notebooks are shareable documents that provide executable code, results from the code, and relevant documentation. This makes it possible to see examples of code that accomplish specific tasks, the results of those tasks, and the documentation that explains the process and can provide insight into the methods and techniques used.

Notebooks are made up of two components: executable code and markdown text. The executable code is interpreted by whatever programming language interpreter used (e.g., R or Python) and results from the code are then displayed dynamically in the document. The markdown is not interpreted or executed but helps structure the document to make it more readable to the human eye. When the code is executed the document also contains the output of the code.

What is necessary to make use of Jupyter notebooks?

In order to use Jupyter notebooks it is necessary to setup a Jupyter server. This is a server that is able to interpret the code and display the results within the notebook.

A server can be set up on virtually any computer on a local hard drive. Jupyter servers are available online as well.

Resources for setting up a Jupyter server

https://jupyter.readthedocs.io/en/latest/

https://jupyter-notebook-beginner-guide.readthedocs.io/en/latest/

https://www.analyticsvidhya.com/blog/2018/05/starters-guide-jupyter-notebook/

https://www.datacamp.com/community/tutorials/tutorial-jupyter-notebook

Do I need to be an experienced programmer to use Jupyter Notebooks?

No. If the server is going to be installed locally on a computer then it requires some comfort with command line processing to install the server software. The resources listed above can help with that. Online Jupyter servers are much easier to use and only really require knowledge of the programming languages used.

What programming languages can I use with Jupyter Notebooks?

The Jupyter server requires a kernel that is able to interpret and execute the code in the notebook. There are an increasing number of kernels that are available; the most common ones are R and Python. However, kernels do exist for Stata (https://github.com/TiesdeKok/ipystata), Javascript, and others. The list at https://github.com/jupyter/jupyter/wiki/Jupyter-kernels contains links to the most commonly used kernels.

Filed under: