Demo Jupyter notebook

This is an integration of Jupyter notebooks and Neuron zettelkasten.

The notebook itself lives in static/notebooks so that it can travel with this repo.

Thanks to GitHub’s notebook preview, a “smart” view of any of the notebooks can be linked to like this:

viewable notebook on github

Or you can download the [notebook itself here](/static/notebooks/Demo.ipynb).

Below is the result of exporting the notebook to markdown and pasting that output here (and updating the references to the images):


# Let's initialize pylab so we can plot later
%pylab inline
Populating the interactive namespace from numpy and matplotlib


x = linspace(0, 2*pi)
plot(x, sin(x), label=r'$\sin(x)$')
plot(x, cos(x), 'ro', label=r'$\cos(x)$')
title(r'Two familiar functions')
legend();

![png](static/notebooks/Demo_files/Demo_1_0.png)
%load_ext sympyprinting
from sympy import init_printing; init_printing()
import sympy as sym
from sympy import *
x, y, z = sym.symbols("x y z")
The sympyprinting extension is already loaded. To reload it, use:
  %reload_ext sympyprinting
Rational(3,2)*pi + exp(I*x) / (x**2 + y)

\(\displaystyle \frac{3 \pi}{2} + \frac{e^{i x}}{x^{2} + y}\)

Rational(3,2)*pi + exp(I*x) / (x**2 + y)

\(\displaystyle \frac{3 \pi}{2} + \frac{e^{i x}}{x^{2} + y}\)

eq = ((x+y)**2 * (x+1))
eq

\(\displaystyle \left(x + 1\right) \left(x + y\right)^{2}\)

expand(eq)

\(\displaystyle x^{3} + 2 x^{2} y + x^{2} + x y^{2} + 2 x y + y^{2}\)

diff(cos(x**2)**2 / (1+x), x)

\(\displaystyle - \frac{4 x \sin{\left(x^{2} \right)} \cos{\left(x^{2} \right)}}{x + 1} - \frac{\cos^{2}{\left(x^{2} \right)}}{\left(x + 1\right)^{2}}\)

This is markdown

with italics and bold and

  • lists
  • and everything.

And images, embedded with python:

from IPython.display import Image
Image(filename='../images/mooskers-search.png')
![png](static/notebooks/Demo_files/Demo_9_0.png)
# this is what a video embed would work like:

from IPython.display import YouTubeVideo
YouTubeVideo('a3HZ8S2H-GQ')
%%ruby
puts "This is ruby! #{ RUBY_VERSION }"
This is ruby! 2.6.5
Links to this page