#!/usr/bin/env python # coding: utf-8 # In[ ]: #https://blog.dominodatalab.com/interactive-dashboards-in-jupyter/ # In[ ]: #http://jupyter.cloudet.xyz/ # In[1]: from ipywidgets import interact, interactive, fixed import ipywidgets as widgets # In[3]: def f(x): print(x) interact(f,x=10) # In[31]: interact(f,x=(0,100,5)) # (start, stop, stepsize) # In[5]: outputText=widgets.Text() outputText # In[9]: inputText=widgets.Text() def makeUpper(dummy): outputText.value=inputText.value.upper() inputText.on_submit(makeUpper) inputText # In[27]: get_ipython().run_line_magic('matplotlib', 'inline') import matplotlib.pyplot as plt from IPython.html.widgets import * import numpy as np t=np.arange(0.0,1.0,0.01) def pltsin(f): plt.plot(t,np.sin(2*np.pi*t*f)) plt.show() interact(pltsin,f=(1,10,0.1)) # In[33]: t # In[25]: import seaborn as sns # In[26]: sns.set_style("whitegrid") # In[35]: get_ipython().system('pip install sympy') # In[68]: from sympy import * from sympy import init_printing init_printing() x = Symbol('x') y = (x + pi)**2 y # In[69]: y.subs(x,2) # In[70]: def eg(xx): return y.subs(x,xx),N(y.subs(x,xx)) interact(eg, xx=(-10.0,10.0)) # In[56]: def factorit(n): return Eq(x**n-1, factor(x**n-1)) interact(factorit, n=(2,40)) # In[ ]: