What is the IPython Notebook.ipynb
179 lines
| 7.9 KiB
| text/plain
|
TextLexer
Brian E. Granger
|
r17481 | { | |
"metadata": { | |||
Jonathan Frederic
|
r17510 | "celltoolbar": "Slideshow", | |
Brian E. Granger
|
r17481 | "name": "", | |
Jonathan Frederic
|
r17510 | "signature": "sha256:ad9cb95b14212dbf9fc8ecafa475d0e368e4cb7c7306b89628b500e7e40068b6" | |
Brian E. Granger
|
r17481 | }, | |
"nbformat": 3, | |||
"nbformat_minor": 0, | |||
Brian E. Granger
|
r17482 | "worksheets": [ | |
{ | |||
"cells": [ | |||
{ | |||
"cell_type": "heading", | |||
"level": 1, | |||
Jonathan Frederic
|
r17510 | "metadata": { | |
"slideshow": { | |||
"slide_type": "slide" | |||
} | |||
}, | |||
Brian E. Granger
|
r17482 | "source": [ | |
"What is the IPython Notebook?" | |||
] | |||
}, | |||
{ | |||
"cell_type": "heading", | |||
"level": 2, | |||
"metadata": {}, | |||
"source": [ | |||
"Introduction" | |||
] | |||
}, | |||
{ | |||
"cell_type": "markdown", | |||
"metadata": {}, | |||
"source": [ | |||
Jonathan Frederic
|
r17510 | "The IPython Notebook is an **interactive computing environment** that enables users to author notebook documents that include: \n", | |
"- Live code\n", | |||
"- Interactive widgets\n", | |||
"- Plots\n", | |||
"- Narrative text\n", | |||
"- Equations\n", | |||
"- Images\n", | |||
"- Video\n", | |||
Brian E. Granger
|
r17482 | "\n", | |
Jonathan Frederic
|
r17510 | "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.ipython.org](http://nbviewer.ipython.org)." | |
] | |||
}, | |||
{ | |||
"cell_type": "heading", | |||
"level": 3, | |||
"metadata": { | |||
"slideshow": { | |||
"slide_type": "slide" | |||
} | |||
}, | |||
"source": [ | |||
"Components" | |||
] | |||
}, | |||
{ | |||
"cell_type": "markdown", | |||
"metadata": {}, | |||
"source": [ | |||
Brian E. Granger
|
r17482 | "The IPython Notebook combines three components:\n", | |
"\n", | |||
"* **The notebook web application**: An interactive web application for writing and running code interactively and authoring notebook documents.\n", | |||
"* **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. \n", | |||
"* **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\n", | |||
"text, equations, images, and rich media representations of objects. Each notebook document has its own kernel." | |||
] | |||
}, | |||
{ | |||
"cell_type": "heading", | |||
"level": 2, | |||
Jonathan Frederic
|
r17510 | "metadata": { | |
"slideshow": { | |||
"slide_type": "slide" | |||
} | |||
}, | |||
Brian E. Granger
|
r17482 | "source": [ | |
"Notebook web application" | |||
] | |||
}, | |||
{ | |||
"cell_type": "markdown", | |||
"metadata": {}, | |||
"source": [ | |||
"The notebook web application enables users to:\n", | |||
"\n", | |||
Jonathan Frederic
|
r17510 | "* **Edit code in the browser**, with automatic syntax highlighting, indentation, and tab completion/introspection.\n", | |
"* **Run code from the browser**, with the results of computations attached to the code which generated them.\n", | |||
"* See the results of computations with **rich media representations**, such as HTML, LaTeX, PNG, SVG, PDF, etc.\n", | |||
"* Create and use **interactive JavaScript wigets**, which bind interactive user interface controls and visualizations to reactive kernel side computations.\n", | |||
"* Author **narrative text** using the [Markdown](https://daringfireball.net/projects/markdown/) markup language.\n", | |||
"* Build **hierarchical documents** that are organized into sections with different levels of headings.\n", | |||
"* Include mathematical equations using **LaTeX syntax in Markdown**, which are rendered in-browser by [MathJax](http://www.mathjax.org/).\n", | |||
"* Start **parallel computing** clusters that work with IPython's interactive parallel computing libraries `IPython.parallel`." | |||
Brian E. Granger
|
r17482 | ] | |
}, | |||
{ | |||
"cell_type": "heading", | |||
"level": 2, | |||
Jonathan Frederic
|
r17510 | "metadata": { | |
"slideshow": { | |||
"slide_type": "slide" | |||
} | |||
}, | |||
Brian E. Granger
|
r17482 | "source": [ | |
"Kernels" | |||
] | |||
}, | |||
{ | |||
"cell_type": "markdown", | |||
"metadata": {}, | |||
"source": [ | |||
Jonathan Frederic
|
r17510 | "Through IPython'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:\n", | |
Brian E. Granger
|
r17482 | "\n", | |
"* Python(https://github.com/ipython/ipython)\n", | |||
"* Julia (https://github.com/JuliaLang/IJulia.jl)\n", | |||
"* R (https://github.com/takluyver/IRkernel)\n", | |||
"* Ruby (https://github.com/minrk/iruby)\n", | |||
"* Haskell (https://github.com/gibiansky/IHaskell)\n", | |||
"* Scala (https://github.com/Bridgewater/scala-notebook)\n", | |||
"* node.js (https://gist.github.com/Carreau/4279371)\n", | |||
"* Go (https://github.com/takluyver/igo)\n", | |||
"\n", | |||
"The default kernel runs Python code. When it is released in the Summer/Fall of 2014, IPython 3.0 will provide a simple way for users to pick which of these kernels is used for a given notebook. \n", | |||
"\n", | |||
"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.\"" | |||
] | |||
}, | |||
{ | |||
"cell_type": "heading", | |||
"level": 2, | |||
Jonathan Frederic
|
r17510 | "metadata": { | |
"slideshow": { | |||
"slide_type": "slide" | |||
} | |||
}, | |||
Brian E. Granger
|
r17482 | "source": [ | |
"Notebook documents" | |||
] | |||
}, | |||
{ | |||
"cell_type": "markdown", | |||
"metadata": {}, | |||
"source": [ | |||
Jonathan Frederic
|
r17510 | "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. " | |
] | |||
}, | |||
{ | |||
"cell_type": "markdown", | |||
"metadata": {}, | |||
"source": [ | |||
"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 using email, Dropbox and version control systems." | |||
] | |||
}, | |||
{ | |||
"cell_type": "markdown", | |||
"metadata": {}, | |||
"source": [ | |||
"Notebooks consist of a **linear sequence of cells**. There are four basic cell types:\n", | |||
Brian E. Granger
|
r17482 | "\n", | |
"* **Code cells:** Input and output of live code that is run in the kernel\n", | |||
"* **Markdown cells:** Narrative text with embedded LaTeX equations\n", | |||
Brian E. Granger
|
r17496 | "* **Heading cells:** 6 levels of hierarchical organization and formatting\n", | |
Brian E. Granger
|
r17482 | "* **Raw cells:** Unformatted text that is included, without modification, when notebooks are converted to different formats using nbconvert\n", | |
"\n", | |||
Jonathan Frederic
|
r17510 | "Internally, notebook documents are **[JSON](http://en.wikipedia.org/wiki/JSO) 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.\n", | |
Brian E. Granger
|
r17482 | "\n", | |
Jonathan Frederic
|
r17510 | "**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 IPython's `nbconvert` utility.\n", | |
Brian E. Granger
|
r17482 | "\n", | |
Jonathan Frederic
|
r17510 | "Furthermore, any notebook document available from a **public URL on or GitHub can be shared** via 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 IPython**." | |
Brian E. Granger
|
r17482 | ] | |
} | |||
], | |||
"metadata": {} | |||
} | |||
] | |||
Brian E. Granger
|
r17481 | } |