forked from ipython/ipython.github.com
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnotebook.html
More file actions
324 lines (279 loc) · 14.4 KB
/
Copy pathnotebook.html
File metadata and controls
324 lines (279 loc) · 14.4 KB
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-38683231-1', 'auto');
ga('send', 'pageview');
</script>
<title>The IPython Notebook — IPython</title>
<link rel="stylesheet" href="_static/agogo.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/ipython.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="shortcut icon" href="_static/favicon.ico"/>
<link rel="top" title="IPython" href="index.html" />
<link rel="next" title="Presentations on IPython" href="presentation.html" />
<link rel="prev" title="News" href="news.html" />
</head>
<body role="document">
<div class="header-wrapper">
<div class="header">
<div class="logo"><a href="index.html">
<img class="logo" src="_static/IPy_header.png" alt="Logo"/>
</a></div>
<div class="rel">
<a href="install.html">Install</a> ·
<a href="documentation.html">Docs</a> ·
<a href="videos.html">Videos</a> ·
<a href="news.html">News</a> ·
<a href="citing.html">Cite</a> ·
<a href="sponsors.html">Sponsors</a> ·
<a href="donate.html">Donate</a>
</div>
</div>
</div>
<div class="content-wrapper">
<div class="content">
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<div class="sidebarblock">
<div id="cse-search-form" style="width: 100%;">Loading</div>
<script src="http://www.google.co.uk/jsapi" type="text/javascript"></script>
<script type="text/javascript">
google.load('search', '1', {language : 'en'});
google.setOnLoadCallback(function() {
var customSearchControl = new google.search.CustomSearchControl(
'017950022472296044740:wfr9nyfshwo');
customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
var options = new google.search.DrawOptions();
options.enableSearchboxOnly("searchresults.html");
customSearchControl.draw('cse-search-form', options);
}, true);
</script>
<link rel="stylesheet" href="http://www.google.com/cse/style/look/default.css" type="text/css" /> <style type="text/css">
input.gsc-input {
border-color: #BCCDF0;
}
input.gsc-search-button {
border-color: #666666;
background-color: #CECECE;
padding: 0;
}
div.sphinxsidebar input[type="text"] {
width: 100%;
}
div.sphinxsidebar input[type="submit"] {
width: 100%;
}
</style>
</div>
<div class="sidebarblock">
<h3>Versions</h3>
<div class="tile"><h4>Stable</h4>
4.0 – August 2015<br/>
<a href="install.html">Install</a>
</div>
<div class="tile"><h4>Development</h4>
4.1.dev<br/>
<a href="https://github.com/ipython/ipython">GitHub</a>
</div>
<div class="tile"><h4>Offline Docs</h4>
All Versions<br/>
<a href="https://github.com/ipython/ipython-doc/tree/gh-pages">GitHub</a>
</div>
</div>
<script type="text/javascript">
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
<div class="sidebarblock">
<h3>Notebook Viewer</h3>
Share your notebooks
<div class="nbviewer-thm-random">
<script src="_static/nbviewer_thm.js"></script>
<script type="text/javascript">
nbviewer_random_thumbnail();
</script>
</div>
</div>
<div class="sidebarblock">
<h3>Community</h3>
<ul class="simple">
<li><a class="reference external" href="http://stackoverflow.com/questions/tagged/ipython">
Stack Overflow</a></li>
<li><a class="reference external" href="http://projects.scipy.org/mailman/listinfo/ipython-dev">
Mailing list</a></li>
<li><a class="reference external" href="https://github.com/ipython/ipython/issues">
File a bug</a></li>
<li><a class="reference external" href="http://www.reddit.com/r/IPython">
Reddit</a></li>
</ul>
<div style="margin-top:10px"> <!-- sharing buttons -->
<!-- twitter -->
<a href="https://twitter.com/share" class="twitter-share-button" data-url="http://ipython.org" data-text="IPython - interactive computing." data-via="ipythondev" data-hashtags="ipython" data-dnt="true">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
<!-- google+ -->
<g:plusone size="medium" annotation="none"></g:plusone>
</div><!-- sharing buttons -->
</div>
<div class="sidebarblock">
<h3>Book</h3>
<a href="books.html"><img
title="Packt Publishing donates a portion of the proceeds from this book to
support IPython's development." width="160" height="200" id="sidebar-book-cover"
style="margin-bottom: 10px;"></a>
<script language="javascript">
window.onload = function() {
var x = Math.random();
var img;
if (x < 0.333) {
url = "_static/ipython-book.jpg";
}
else {
url = "_static/ipython-cookbook.jpg";
}
$("#sidebar-book-cover").attr("src", url);
}
</script>
</div>
<div class="sidebarblock">
<h3>For developers</h3>
<ul class="simple">
<li><a class="reference external" href="https://gitter.im/ipython/ipython">
Development Chat Room</a></li>
<li><a class="reference external"
href="https://github.com/ipython/ipython/wiki/Dev:-Index">Development information</a></li>
<li><a class="reference external" href="http://travis-ci.org/#!/ipython/ipython">
Travis CI</a></li>
<li><a class="reference external" href="https://github.com/ipython/ipython/wiki">Wiki</a></li>
</ul>
</div>
<div class="sidebarblock">
<div class="tile" id="donate">
<h4>Support IPython</h4>
<center>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="SMCAHLP2ST42G">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
</center>
<a href="donate.html">Find out more...</a>
</div>
</div>
</div>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="the-ipython-notebook">
<span id="notebook"></span><h1>The IPython Notebook<a class="headerlink" href="#the-ipython-notebook" title="Permalink to this headline">¶</a></h1>
<p>The IPython Notebook is an interactive computational environment, in which you
can combine code execution, rich text, mathematics, plots and rich media, as
shown in this example session:</p>
<div align="center"><a class="reference external image-reference" href="_static/sloangrant/9_home_fperez_prof_grants_1207-sloan-ipython_proposal_fig_ipython-notebook-specgram.png"><img alt="The IPython notebook with embedded rich text, code, mathematics and figures." src="_images/9_home_fperez_prof_grants_1207-sloan-ipython_proposal_fig_ipython-notebook-specgram.png" style="width: 350px;" /></a>
</div><p>It aims to be an agile tool for both exploratory computation and data analysis,
and provides a platform to support <strong>reproducible research</strong>, since all inputs
and outputs may be stored in a one-to-one way in notebook documents.</p>
<p>There are two components:</p>
<ul class="simple">
<li>The <strong>IPython Notebook</strong> web application, for interactive authoring of literate computations, in which explanatory text, mathematics, computations and rich media output may be combined. Input and output are stored in persistent cells that may be edited in-place.</li>
<li>Plain text documents, called <strong>notebooks</strong>, for recording and distributing the results of the rich computations.</li>
</ul>
<p>The Notebook app automatically saves the current state of the computation in
the web browser to the corresponding notebook, which is just a standard text
file with the extension <code class="docutils literal"><span class="pre">.ipynb</span></code>, stored in a working directory on your
computer. This file can be easily put under version control and shared with
colleagues.</p>
<p>Despite the fact that the notebook documents are plain text files, they use
the JSON format in order to store a <strong>complete</strong>, <strong>reproducible</strong> copy of the
current state of the computation inside the Notebook app.</p>
<div class="section" id="features-of-the-ipython-notebook-web-app">
<h2>Features of the IPython Notebook web app<a class="headerlink" href="#features-of-the-ipython-notebook-web-app" title="Permalink to this headline">¶</a></h2>
<p>Some of the main features of the IPython Notebook app include:</p>
<ul class="simple">
<li>Display rich data representations (e.g. HTML / LaTeX / SVG) in the browser as a result of computations.</li>
<li>Compose rich text using <a class="reference external" href="http://daringfireball.net/projects/markdown/syntax">Markdown</a> and HTML.</li>
<li>Include mathematical equations, rendered directly in the browser by <a class="reference external" href="http://mathjax.org">MathJax</a>.</li>
<li>Import standard Python scripts.</li>
<li>In-browser editing, syntax highlighting, tab completion and autoindentation.</li>
<li>Inline figures rendered by the <a class="reference external" href="http://matplotlib.org">matplotlib</a> library with publication quality, in a range of formats (SVG / PDF / PNG).</li>
</ul>
<p>If you have ever used the Mathematica or SAGE notebooks (the latter is also
<a class="reference external" href="http://sagenb.org">web-based</a>) you should feel right at home. If you have not, you will be
able to learn how to use the IPython Notebook in just a few minutes.</p>
</div>
<div class="section" id="notebook-documents">
<h2>Notebook documents<a class="headerlink" href="#notebook-documents" title="Permalink to this headline">¶</a></h2>
<p>Notebook documents (or notebooks) are files which record all computations
carried out and the results obtained in a literate way, including inputs,
outputs, toegether with descriptive text and mathematics.</p>
<p>They are plain text files, which are thus easy to share with colleagues and
place under version control. But, by using the JSON format, they can record
all aspects of the computation, including embedding rich media output. The
standard file extension for notebook documents is <code class="docutils literal"><span class="pre">.ipynb</span></code>.</p>
<p>Notebooks may easily be <a class="reference external" href="http://ipython.org/ipython-doc/stable/interactive/nbconvert.html">exported</a> to a range of static formats, including HTML
(for example, for blog posts), PDF and slide shows. Any publicly
available notebook may be shared via the <a class="reference external" href="http://nbviewer.ipython.org">IPython Notebook Viewer</a> service, which will provide it as a static web
page. This makes it easy to give your colleagues a document they
can read immediately without having to install anything.</p>
<p>To learn more about using the IPython Notebook, you can visit our <a class="reference external" href="http://nbviewer.ipython.org/github/ipython/ipython/blob/2.x/examples/Notebook/Index.ipynb">example
collection</a>, and you can read the <a class="reference external" href="http://ipython.org/ipython-doc/stable/interactive/notebook.html">documentation</a> for all the details on how
to use and configure the system. The <a class="reference external" href="https://github.com/ipython/ipython/wiki/A-gallery-of-interesting-IPython-Notebooks">notebook gallery</a> showcases many
interesting notebooks covering a variety of topics, from basic programming to
advanced scientific computing.</p>
<p>Here is a short demo of the IPython Notebook’s basic features by the
<a class="reference external" href="http://pybonacci.org">Pybonacci</a> team:</p>
<div align="center">
<iframe title="YouTube video player2"
width="550" height="350"
src="http://www.youtube.com/embed/H6dLGQw9yFQ"
frameborder="0" allowfullscreen>
</iframe></div><br><p>For a thorough introduction to the IPython Notebook, you can check out the
<em>IPython in Depth</em> tutorial from the <a class="reference internal" href="#scipy-2013">SciPy 2013</a> scientific Python
conference, led by the two creators of the IPython package, Fernando Pérez
and Brian Granger:</p>
<div align="center">
<iframe title="YouTube video player3"
<iframe width="560" height="315"
src="http://www.youtube.com/embed/xe_ATRmw0KM" frameborder="0"
allowfullscreen></iframe>
</div><br><span class="target" id="scipy-2013"></span></div>
</div>
</div>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
</div>
<div class="footer-wrapper">
<div class="footer" role="contentinfo">
© Copyright the IPython development team.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1.
</div>
</div>
</body>
</html>