Jupyter Demo

By Jonas Kersulis, for 2016-03-24 group presentation

Interface

  • The notebook lives in the browser.
  • It consists of cells.
  • Cells may be cut, copied, split, combined, and --most importantly-- run.

In [ ]:
a = 1;

In [ ]:
b = 2;

In [ ]:
c = 3

Prose + math + code

Sum of squares: Return the sum of squares of elements for a given input vector $a$.

\begin{align} a &= \begin{bmatrix} a_1 & a_2 & \cdots & a_n \end{bmatrix} \\ x &= \sum_{i=1}^n a_i^2 \end{align}

Also, plot the cumulative sum.

One possible implementation:

sumsq = 0;
for i = 1:length(a)
    sumsq = [sumsq sumsq(end)+a(i)^2];
end

Let's try it:


In [ ]:
a = [1 2 3 3 2 1];
sumsq = 0;
for i = 1:length(a)
    sumsq = [sumsq sumsq(end)+a(i)^2];
end
plot(sumsq)
xlabel('No. of elements accumulated')
ylabel('Sum of squares of elements')

Language-agnostic

A Jupyter notebook doesn't care which programming language you want to use. You can switch kernels any time.

Export to any format

Export to HTML, PDF, raw code, etc.