In [1]:
# Show ipython page
from IPython.display import display, Image, HTML
HTML('<iframe src=http://ipython.org width=1000 height=400> </iframe>')
Out[1]:
Jim Gray et al. "Scientific Data Management in the coming Decade" (2005)
"The goal is a smart notebook that empowers scientists to explore the world’s data. Science data centers with computational resources to explore huge data archives will be central to enabling such notebooks. Because data is so large, and IO bandwidth is not keeping pace, moving code to data will be essential to performance. Consequently, science centers will remain the core vehicle and federations will likely be secondary. Science centers will provide both the archives and the institutional infrastructure to develop these peta-scale archives and the algorithms and tools to analyze them."
In [2]:
HTML('<iframe src=http://nbviewer.ipython.org/github/ipython/ipython-in-depth/blob/master/examples/Notebook/What%20is%20the%20IPython%20Notebook.ipynb width=1000 height=400></iframe>')
Out[2]:
In [ ]:
!ipython nbconvert --to slides ipython-intro.ipynb --post serve
This is rich text with links, equations:
$$\hat{f}(\xi) = \int_{-\infty}^{+\infty} f(x)\, \mathrm{e}^{-i \xi x}$$code with syntax highlighting:
print("Hello world!")
and images:
In [1]:
%lsmagic
Out[1]:
In [2]:
from IPython.display import HTML, SVG
HTML('''
<table style="border: 2px solid black;">
''' +
''.join(['<tr>' +
''.join(['<td>{row},{col}</td>'.format(
row=row, col=col
) for col in range(5)]) +
'</tr>' for row in range(5)]) +
'''
</table>
''')
Out[2]:
In [3]:
from IPython.html.widgets import interact
import matplotlib.pyplot as plt
import networkx as nx
%matplotlib inline
In [4]:
# wrap a few graph generation functions so they have the same signature
def random_lobster(n, m, k, p):
return nx.random_lobster(n, p, p / m)
def powerlaw_cluster(n, m, k, p):
return nx.powerlaw_cluster_graph(n, m, p)
def erdos_renyi(n, m, k, p):
return nx.erdos_renyi_graph(n, p)
def newman_watts_strogatz(n, m, k, p):
return nx.newman_watts_strogatz_graph(n, k, p)
def plot_random_graph(n, m, k, p, generator):
g = generator(n, m, k, p)
nx.draw(g)
plt.show()
In [5]:
interact(plot_random_graph, n=(2,30), m=(1,10), k=(1,10), p=(0.0, 1.0, 0.001),
generator={'lobster': random_lobster,
'power law': powerlaw_cluster,
'Newman-Watts-Strogatz': newman_watts_strogatz,
u'Erdős-Rényi': erdos_renyi,
});
In [ ]: