1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136
|
`View the original notebook on nbviewer <http://nbviewer.jupyter.org/github/jupyter/notebook/blob/master/docs/source/examples/Notebook/What%20is%20the%20Jupyter%20Notebook.ipynb>`__
What is the Jupyter Notebook?
=============================
Introduction
------------
The Jupyter Notebook is an **interactive computing environment** that
enables users to author notebook documents that include: - Live code -
Interactive widgets - Plots - Narrative text - Equations - Images -
Video
These documents provide a **complete and self-contained record of a
computation** that can be converted to various formats and shared with
others using email, `Dropbox <http://dropbox.com>`__, version control
systems (like git/\ `GitHub <http://github.com>`__) or
`nbviewer.jupyter.org <http://nbviewer.jupyter.org>`__.
Components
~~~~~~~~~~
The Jupyter Notebook combines three components:
- **The notebook web application**: An interactive web application for
writing and running code interactively and authoring notebook
documents.
- **Kernels**: Separate processes started by the notebook web
application that runs users' code in a given language and returns
output back to the notebook web application. The kernel also handles
things like computations for interactive widgets, tab completion and
introspection.
- **Notebook documents**: Self-contained documents that contain a
representation of all content visible in the notebook web
application, including inputs and outputs of the computations,
narrative text, equations, images, and rich media representations of
objects. Each notebook document has its own kernel.
Notebook web application
------------------------
The notebook web application enables users to:
- **Edit code in the browser**, with automatic syntax highlighting,
indentation, and tab completion/introspection.
- **Run code from the browser**, with the results of computations
attached to the code which generated them.
- See the results of computations with **rich media representations**,
such as HTML, LaTeX, PNG, SVG, PDF, etc.
- Create and use **interactive JavaScript widgets**, which bind
interactive user interface controls and visualizations to reactive
kernel side computations.
- Author **narrative text** using the
`Markdown <https://daringfireball.net/projects/markdown/>`__ markup
language.
- Build **hierarchical documents** that are organized into sections
with different levels of headings.
- Include mathematical equations using **LaTeX syntax in Markdown**,
which are rendered in-browser by
`MathJax <http://www.mathjax.org/>`__.
Kernels
-------
Through Jupyter's kernel and messaging architecture, the Notebook allows
code to be run in a range of different programming languages. For each
notebook document that a user opens, the web application starts a kernel
that runs the code for that notebook. Each kernel is capable of running
code in a single programming language and there are kernels available in
the following languages:
- Python(https://github.com/ipython/ipython)
- Julia (https://github.com/JuliaLang/IJulia.jl)
- R (https://github.com/takluyver/IRkernel)
- Ruby (https://github.com/minrk/iruby)
- Haskell (https://github.com/gibiansky/IHaskell)
- Scala (https://github.com/Bridgewater/scala-notebook)
- node.js (https://gist.github.com/Carreau/4279371)
- Go (https://github.com/takluyver/igo)
The default kernel runs Python code. The notebook provides a simple way
for users to pick which of these kernels is used for a given notebook.
Each of these kernels communicate with the notebook web application and
web browser using a JSON over ZeroMQ/WebSockets message protocol that is
described
`here <http://ipython.org/ipython-doc/dev/development/messaging.html>`__.
Most users don't need to know about these details, but it helps to
understand that "kernels run code."
Notebook documents
------------------
Notebook documents contain the **inputs and outputs** of an interactive
session as well as **narrative text** that accompanies the code but is
not meant for execution. **Rich output** generated by running code,
including HTML, images, video, and plots, is embeddeed in the notebook,
which makes it a complete and self-contained record of a computation.
When you run the notebook web application on your computer, notebook
documents are just **files on your local filesystem with a ``.ipynb``
extension**. This allows you to use familiar workflows for organizing
your notebooks into folders and sharing them with others.
Notebooks consist of a **linear sequence of cells**. There are four
basic cell types:
- **Code cells:** Input and output of live code that is run in the
kernel
- **Markdown cells:** Narrative text with embedded LaTeX equations
- **Heading cells:** 6 levels of hierarchical organization and
formatting
- **Raw cells:** Unformatted text that is included, without
modification, when notebooks are converted to different formats using
nbconvert
Internally, notebook documents are
**`JSON <http://en.wikipedia.org/wiki/JSON>`__ data** with **binary
values `base64 <http://en.wikipedia.org/wiki/Base64>`__** encoded. This
allows them to be **read and manipulated programmatically** by any
programming language. Because JSON is a text format, notebook documents
are version control friendly.
**Notebooks can be exported** to different static formats including
HTML, reStructeredText, LaTeX, PDF, and slide shows
(`reveal.js <http://lab.hakim.se/reveal-js/#/>`__) using Jupyter's
``nbconvert`` utility.
Furthermore, any notebook document available from a **public URL on or
GitHub can be shared** via `nbviewer <http://nbviewer.ipython.org>`__.
This service loads the notebook document from the URL and renders it as
a static web page. The resulting web page may thus be shared with others
**without their needing to install the Jupyter Notebook**.
`View the original notebook on nbviewer <http://nbviewer.jupyter.org/github/jupyter/notebook/blob/master/docs/source/examples/Notebook/What%20is%20the%20Jupyter%20Notebook.ipynb>`__
|