I noticed my fact function: from scipy.special import gamma def fact(x): return gamma (x+1) Wasn't working. Then I see: gamma <built-in method gamma of mtrand.RandomState object at 0x7f4934b86c90> Looks like there's a conflict in scipy over the name 'gamma' (I guess this was pulled in later in my script when I did 'from pylab import *')