# Let's initialize pylab so we can plot later %pylab inline 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(); %load_ext sympyprinting import sympy as sym from sympy import * x, y, z = sym.symbols("x y z") Rational(3,2)*pi + exp(I*x) / (x**2 + y) eq = ((x+y)**2 * (x+1)) eq expand(eq) diff(cos(x**2)**2 / (1+x), x) from IPython.display import Image Image(filename='fig/img_4926.jpg') from IPython.display import YouTubeVideo YouTubeVideo('iwVvqwLDsJo') %%ruby puts "Hello from Ruby #{RUBY_VERSION}" %%bash echo "hello from $BASH" %load_ext octavemagic %%octave -s 500,500 # butterworth filter, order 2, cutoff pi/2 radians b = [0.292893218813452 0.585786437626905 0.292893218813452]; a = [1 0 0.171572875253810]; freqz(b, a, 32); %load_ext rmagic X = np.array([0,1,2,3,4]) Y = np.array([3,5,4,6,7]) %%R -i X,Y -o XYcoef XYlm = lm(Y~X) XYcoef = coef(XYlm) print(summary(XYlm)) par(mfrow=c(2,2)) plot(XYlm) XYcoef %load_ext cythonmagic %%cython -lm from libc.math cimport sin print 'sin(1)=', sin(1)