fancy latex
$\Rightarrow\mu\nabla^2
\underbrace{\left[\frac{\partial^2w}{\partial X^2} + \frac{\partial^2w}{\partial Y^2} + \frac{\partial^2w}{\partial Z^2}\right.}
_{=\nabla^2w} - \frac{\partial}{\partial Z}
\underbrace{\left.\left(\frac{\partial u}{\partial X} + \frac{\partial v}{\partial Y} + \frac{\partial w}{\partial Z}\right)\right]}
_{\overset{(4)}{=} 0}
= g\underbrace{\left(\frac{\partial^2\theta}{\partial Y^2} + \frac{\partial\theta^2}{\partial X^2}\right)}
_{=\nabla^2\theta - \frac{\partial^2\theta}{\partial Z^2}}$
In [2]:
#comments and numbers work normally
1 + 1
Out[2]:
In [23]:
#strings too
s = 'hello hacky people'
s
Out[23]:
In [4]:
#variables can be assigned and will be known to all cells below this one
a,b = (10,10)
#output without print-statement only works if at the end of a cell
print(a+b)
#functions and classes can be defined like normal
def MyFunction(a,b):
return [a+b,a-b,a*b,a/b]
MyFunction(a,b)
Out[4]:
In [17]:
import numpy as np
c = np.arange(0,16).reshape((4,4))
d = np.ones((4,4))
#numpy arrays work!
print('marix c:\n',c)
print('matrix d:\n',d)
#a is still know from before... see?
print('scalar times matrix:\n',a*c)
print('matrix times matrix:\n',np.dot(c,d))
In [21]:
#by the way: error messages and tracebacks work as well... :/
import seaborn as sns
#get the package via "conda install seaborn" in your terminal
In [25]:
import matplotlib.pyplot as plt
#allows plots to be shown embedded in the notebook
%matplotlib inline
#create a beautiful poser-plot
x = np.linspace(0, 2 * np.pi, 500)
y1 = np.sin(x)
y2 = np.sin(3 * x)
fig, ax = plt.subplots()
nice_plot = ax.fill(x, y1, 'b', x, y2, 'r', alpha=0.3)
In [12]:
#magic commands are available
%timeit(a*b)
In [13]:
#run other notebooks or .py files
%run polar-chart.ipynb
In [15]:
#direct access to docstrings
?np.reshape()
In [ ]: