In [33]:
from IPython.display import Latex
Latex(r"$\sqrt{x^2+y^2}$")
Out[33]:
In [2]:
from IPython.external.mathjax import install_mathjax
install_mathjax()
In [14]:
%reload_ext sympyprinting
#from sympy import *
#import sympy
from sympy import init_printing
init_printing()
x, y = symbols("x,y")
sqrt(x**2+y**2)
In [16]:
import cv2
import numpy as np
from IPython.display import Image
img = np.random.randint(0,255,(250,250,3))
cv2.blur(img, (11,11), img)
r, dat = cv2.imencode(".png",img)
Image(dat.tostring())
In [19]:
from IPython.display import Javascript
Javascript("alert('JavaScript call, ok!客户端调用')")
Out[19]:
In [25]:
%timeit 1 + 1
%timeit 1.0 + 1.0
%timeit "1" + "1"
#10000000 loops, best of 3: 52 ns per loop
#10000000 loops, best of 3: 53.4 ns per loop
#10000000 loops, best of 3: 50.9 ns per loop
#%%timeit
s = 0
for i in range(100):
s += i
#100000 loops, best of 3: 11 us per loop
In [26]:
%pylab inline
plot(random.randn(100));
In [29]:
%%prun
for i in range(100):
linalg.det(random.rand(10,10))
In [ ]: