-
git_notebook
-
pystart
Notebook
Out[33]:
$\sqrt{x^2+y^2}$
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-2-9209d90709e3> in <module>()
----> 1 from IPython.external.mathjax import install_mathjax
2 install_mathjax()
ImportError: cannot import name 'install_mathjax'
/home/supermap/anaconda3/envs/GISpark/lib/python3.5/site-packages/IPython/extensions/sympyprinting.py:31: UserWarning: The sympyprinting extension has moved to `sympy`, use `from sympy import init_printing; init_printing()`
warnings.warn("The sympyprinting extension has moved to `sympy`, "
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-14-2e02b2f1da3e> in <module>()
2 #from sympy import *
3 #import sympy
----> 4 from sympy import init_printing
5 init_printing()
6 x, y = symbols("x,y")
ImportError: No module named 'sympy'
from IPython.display import Image
Image(filename="python.png")
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-16-d79b771ba93f> in <module>()
3 from IPython.display import Image
4 img = np.random.randint(0,255,(250,250,3))
----> 5 cv2.blur(img, (11,11), img)
6 r, dat = cv2.imencode(".png",img)
7 Image(dat.tostring())
TypeError: Layout of the output array dst is incompatible with cv::Mat (step[ndims-1] != elemsize or step[1] != elemsize*nchannels)
The slowest run took 62.86 times longer than the fastest. This could mean that an intermediate result is being cached.
10000000 loops, best of 3: 17.5 ns per loop
10000000 loops, best of 3: 14 ns per loop
The slowest run took 85.72 times longer than the fastest. This could mean that an intermediate result is being cached.
10000000 loops, best of 3: 16.3 ns per loop
Populating the interactive namespace from numpy and matplotlib
%load http://matplotlib.org/mpl_examples/pylab_examples/histogram_demo.py
#!/usr/bin/env python
import numpy as np
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
mu, sigma = 100, 15
x = mu + sigma*np.random.randn(10000)
# the histogram of the data
n, bins, patches = plt.hist(x, 50, normed=1, facecolor='green', alpha=0.75)
# add a 'best fit' line
y = mlab.normpdf( bins, mu, sigma)
l = plt.plot(bins, y, 'r--', linewidth=1)
plt.xlabel('Smarts')
plt.ylabel('Probability')
plt.title(r'$\mathrm{Histogram\ of\ IQ:}\ \mu=100,\ \sigma=15$')
plt.axis([40, 160, 0, 0.03])
plt.grid(True)
plt.show()