[SciPy-user] Binomial coefficients

Nils Wagner nwagner at mecha.uni-stuttgart.de
Tue Feb 24 09:02:11 CST 2004


Hi all,

I am wondering if binomial coefficients are currently available in
scipy.
If that is not the case, I would like to add this feature to scipy
Any comment ?

Nils


from scipy import *

def binomial(a,b):
  return
int(special.gamma(a+1)/(special.gamma(b+1)*special.gamma(a-b+1)))

#
# The following table is given in Bronstein Taschenbuch der Mathematik
#
for n in arange(0,21):
  for k in arange(0,11):
    print binomial(n,k)
  print



More information about the SciPy-user mailing list