when I use
from numpy.math import factorial as fact
I get : ImportError: No module named 'numpy.math'
but
import numpy
fact=numpy.math.factorial
works.
Why ? Is numpy.math really implemented like other modules ?
numpy seems to import the standard math library:
In [8]: import numpy
In [9]: import math
In [10]: math is numpy.math
Out[10]: True
So it is not the submodule of numpy, just an imported module object. That is why you can not import like this: from numpy.math import something .
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With