[Numpy-discussion] NaN (Not a Number) occurs in calculation of complex number for Bessel functions

Pauli Virtanen pav at iki.fi
Fri Dec 21 08:17:21 EST 2012

Happyman <bahtiyor_zohidov <at> mail.ru> writes:
> Thanks Pauli But I have already very shortly built  for bessel
> function, but the code you gave me is in Fortran.. I also used
> f2py but I could not manage to read fortran codes..that is why
> I have asked in Python what is wrong??

That Fortran code is `sph_jn`, which you used. It works using f2py.

Only some of the special functions in scipy.special are written
using Python as the language. Most of them are in C or in Fortran,
using some existing special function library not written by us.

Some of the implementations provided by these libraries are not
complete, and do not cover the whole complex plane (or the real axis). 
Other functions (the more common ones), however, have very good

Pauli Virtanen

More information about the NumPy-Discussion mailing list