>>> from scipy import special
>>> special.beta(
... )
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: invalid number of arguments
>>> special.beta(5,3)
0.0095238095238095247
>>> 1/105.
0.009523809523809525
>>> special.betainc(5,3)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: invalid number of arguments
>>> special.betainc(5,3,0.5)
0.22656249999999992
>>> from pylab import *
>>> x = arange(0,1,1e-4)
>>> y = special.betainc(5,3,x)
>>> plot(x,y)
[<matplotlib.lines.Line2D object at 0x99e79ac>]
>>> title("Gamma distribution of parameters 5,3")
<matplotlib.text.Text object at 0x9869fac>
>>> xlabel ("x")
<matplotlib.text.Text object at 0x9856ccc>
>>> ylabel("$\int_{0}^{x}x^{4}(1-x)^2 dx$")
<matplotlib.text.Text object at 0x985db0c>
>>> show()
>>> y2 = [][:6666] ]
>>> y2.join( [][6666:] ] )
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'list' object has no attribute 'join'
>>> y2.append( [][6666:] ] )
>>> plot(x,y2)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/site-packages/matplotlib/pyplot.py", line 2287, in plot
ret = ax.plot(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/matplotlib/axes.py", line 3771, in plot
for line in self._get_lines(*args, **kwargs):
File "/usr/lib/python2.7/site-packages/matplotlib/axes.py", line 317, in _grab_next_args
for seg in self._plot_args(remaining, kwargs):
File "/usr/lib/python2.7/site-packages/matplotlib/axes.py", line 287, in _plot_args
y = np.atleast_1d(tup[-1])
File "/usr/lib/python2.7/site-packages/numpy/core/shape_base.py", line 47, in atleast_1d
res.append(array(ary,copy=False,subok=True,ndmin=1))
ValueError: setting an array element with a sequence.
>>> len(y2)
6667
>>> help(y2)
>>> y2.remove(-1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: list.remove(x): x not in list
>>> del y2[-1]
>>> len(y2)
6666
>>> y2.extend( [][6666:] ] )
>>> len(y2)
10000
>>> len(x)
10000
>>> plot(x,y2)
[<matplotlib.lines.Line2D object at 0x9eca24c>]
>>> title('$x$')
<matplotlib.text.Text object at 0x9cc5aac>
>>> title('Echantillonnage preferentiel')
<matplotlib.text.Text object at 0x9cc5aac>
>>> xlabel("$x$")
<matplotlib.text.Text object at 0x944578c>
>>> ylabel("$f^{*}(x)$")
<matplotlib.text.Text object at 0x9cbcacc>
>>> show()
>>> y3 = [ r**4 * (1-r)**2 for r in x ]
>>> plot(x,y3);title("Integrand $x^4(1-x)^2$");xlabel("x");ylabel("$y=x^4(1-x)^2$")
[<matplotlib.lines.Line2D object at 0x986972c>]
<matplotlib.text.Text object at 0x99dd50c>
<matplotlib.text.Text object at 0x9ec8d4c>
<matplotlib.text.Text object at 0x9cc528c>
>>> show()