0

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?

2

1 Answer 1

1

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

scipy.special.spherical_jn(...)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .