I need to use the spherical Bessel function in my code and I saw there is the scipy.special module that has lots of special functions already defined, including the spherical Bessel functions. I want to use the pre-defined functions and I wrote the following two line of code:

import scipy.special
import scipy.special.spherical_jn

but I receive the following error:

Traceback (most recent call last):
  File "<pyshell#47>", line 1, in <module>
    import scipy.special.spherical_jn
ImportError: No module named spherical_jn

Do you have any idea what I'm doing wrong?

| |

spherical_jn is a function, not a module, so you import scipy.special and then call the function on the module.

| |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.