This notebook on nbviewer
from ipywidgets import interact
from sympy import Symbol, Eq, factor
from sympy.interactive import init_printing
init_printing(use_latex='mathjax')
x = Symbol('x')
x
@interact
def factorit(n=12):
return Eq(x**n-1, factor(x**n-1))
Inline plotting with matplotlib
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
We want to plot:
y=sin(ωt)def plot_sinωt(ω=3, T=5):
t = np.linspace(0, T, 1000)
y = np.sin(ω * t)
plt.plot(t, y)
plt.title(r"$\omega = %s$" % ω)
plot_sinωt(5, 5)
# interact(plot_sinωt)
import time
from bokeh.io import output_notebook, show
from bokeh.charts import Scatter
from bokeh.sampledata.iris import flowers
output_notebook()
# fill a data frame with the data of interest and create a groupby object
df = flowers[["petal_length", "petal_width", "species"]]
xyvalues = df.groupby("species")
TOOLS="resize,crosshair,pan,wheel_zoom,box_zoom,reset,previewsave"
scatter = Scatter(xyvalues, tools=TOOLS, ylabel='petal_width')
show(scatter)