def f(x): return (x-3)*(x-5)*(x-7)+85 import numpy as np x = np.linspace(0, 10, 200) y = f(x) plot(x,y) from IPython.display import HTML HTML("") from IPython.display import YouTubeVideo YouTubeVideo("BS4Wd5rwNwE") from sympy import * %load_ext sympyprinting x, y = symbols("x y") eq = ((x+y)**2 * (x+1)) eq expand(eq) (1/cos(x)).series(x, 0, 6) %lsmagic %timeit np.linalg.eigvals(np.random.rand(100,100)) %%timeit a = np.random.rand(100, 100) np.linalg.eigvals(a) %%ruby puts "Hello from Ruby #{RUBY_VERSION}" %%bash echo "hello from $BASH" %load_ext rmagic x,y = arange(10), random.normal(size=10) %%R -i x,y -o XYcoef lm.fit <- lm(y~x) par(mfrow=c(2,2)) print(summary(lm.fit)) plot(lm.fit) XYcoef <- coef(lm.fit) XYcoef from IPython.parallel import Client client = Client() dv = client.direct_view() len(dv) def where_am_i(): import os import socket return "In process with pid {0} on host: '{1}'".format( os.getpid(), socket.gethostname()) where_am_i_direct_results = dv.apply(where_am_i) where_am_i_direct_results.get()