In [1]:
!cat /biipy/version
In [2]:
import numpy as np
a = np.arange(100)
a
Out[2]:
In [3]:
np.__config__.show()
In [4]:
%matplotlib inline
import matplotlib.pyplot as plt
plt.plot(a);
In [5]:
def f(x):
y = np.empty_like(x)
for i in range(x.size):
y[i] = x[i] * 2
return y
In [6]:
x = np.arange(1000000)
In [7]:
%timeit f(x)
In [8]:
import numba
In [9]:
fjit = numba.jit(f)
In [10]:
%timeit fjit(x)
In [11]:
np.array_equal(f(x), fjit(x))
Out[11]:
In [12]:
from bokeh.plotting import figure, show
from bokeh.io import output_notebook
output_notebook()
In [13]:
n = 4000
x = np.random.random(size=n) * 100
y = np.random.random(size=n) * 100
radii = np.random.random(size=n) * 1.5
colors = ["#%02x%02x%02x" % (int(r), int(g), 150) for r, g in zip(np.floor(50+2*x), np.floor(30+2*y))]
In [14]:
p = figure()
p.circle(x, y, radius=radii, fill_color=colors, fill_alpha=.9, line_color=None)
Out[14]:
In [15]:
show(p)
Out[15]:
In [ ]: