MOON MOON - 1 year ago 1831
Python Question

Factorial in numpy and scipy

How can I import factorial function from numpy and scipy separately in order to see which one is faster?

I already imported factorial from python itself by import math. But, it does not work for numpy and scipy.

Answer Source

You can import them like this:

In [7]: import scipy, numpy, math                                                          

In [8]: scipy.math.factorial, numpy.math.factorial, math.factorial
(<function math.factorial>,                                                                
 <function math.factorial>,                                                                
 <function math.factorial>)     
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download