special

Nearly all of the functions below are universal functions and follow broadcasting and automatic array-looping rules. Exceptions are noted.

See also

scipy.special.cython_special – Typed Cython versions of special functions

Error handling

Errors are handled by returning NaNs or other appropriate values. Some of the special function routines can emit warnings or raise exceptions when an error occurs. By default this is disabled; to query and control the current error handling state the following functions are provided.

geterr
seterr
errstate
SpecialFunctionWarning
SpecialFunctionError

Available functions

Airy functions

airy
airye
ai_zeros
bi_zeros
itairy

Elliptic Functions and Integrals

ellipj
ellipk
ellipkm1
ellipkinc
ellipe
ellipeinc

Bessel Functions

jv
jn
jve
yn
yv
yve
kn
kv
kve
iv
ive
hankel1
hankel1e
hankel2
hankel2e

The following is not an universal function:

lmbda
Zeros of Bessel Functions

These are not universal functions:

jnjnp_zeros
jnyn_zeros
jn_zeros
jnp_zeros
yn_zeros
ynp_zeros
y0_zeros
y1_zeros
y1p_zeros
Faster versions of common Bessel Functions
j0
j1
y0
y1
i0
i0e
i1
i1e
k0
k0e
k1
k1e
Integrals of Bessel Functions
itj0y0
it2j0y0
iti0k0
it2i0k0
besselpoly
Derivatives of Bessel Functions
jvp
yvp
kvp
ivp
h1vp
h2vp
Spherical Bessel Functions
spherical_jn
spherical_yn
spherical_in
spherical_kn
Riccati-Bessel Functions

These are not universal functions:

riccati_jn
riccati_yn

Struve Functions

struve
modstruve
itstruve0
it2struve0
itmodstruve0

Raw Statistical Functions

See also

scipy.stats: Friendly versions of these functions.

bdtr
bdtrc
bdtri
bdtrik
bdtrin
btdtr
btdtri
btdtria
btdtrib
fdtr
fdtrc
fdtri
fdtridfd
gdtr
gdtrc
gdtria
gdtrib
gdtrix
nbdtr
nbdtrc
nbdtri
nbdtrik
nbdtrin
ncfdtr
ncfdtridfd
ncfdtridfn
ncfdtri
ncfdtrinc
nctdtr
nctdtridf
nctdtrit
nctdtrinc
nrdtrimn
nrdtrisd
pdtr
pdtrc
pdtri
pdtrik
stdtr
stdtridf
stdtrit
chdtr
chdtrc
chdtri
chdtriv
ndtr
log_ndtr
ndtri
chndtr
chndtridf
chndtrinc
chndtrix
smirnov
smirnovi
kolmogorov
kolmogi
tklmbda
logit
expit
boxcox
boxcox1p
inv_boxcox
inv_boxcox1p

Information Theory Functions

entr
rel_entr
kl_div
huber
pseudo_huber

Error Function and Fresnel Integrals

erf
erfc
erfcx
erfi
erfinv
erfcinv
wofz
dawsn
fresnel
fresnel_zeros
modfresnelp
modfresnelm

These are not universal functions:

erf_zeros
fresnelc_zeros
fresnels_zeros

Legendre Functions

lpmv
sph_harm

These are not universal functions:

clpmn
lpn
lqn
lpmn
lqmn

Ellipsoidal Harmonics

ellip_harm
ellip_harm_2
ellip_normal

Orthogonal polynomials

The following functions evaluate values of orthogonal polynomials:

assoc_laguerre
eval_legendre
eval_chebyt
eval_chebyu
eval_chebyc
eval_chebys
eval_jacobi
eval_laguerre
eval_genlaguerre
eval_hermite
eval_hermitenorm
eval_gegenbauer
eval_sh_legendre
eval_sh_chebyt
eval_sh_chebyu
eval_sh_jacobi

The following functions compute roots and quadrature weights for orthogonal polynomials:

roots_legendre
roots_chebyt
roots_chebyu
roots_chebyc
roots_chebys
roots_jacobi
roots_laguerre
roots_genlaguerre
roots_hermite
roots_hermitenorm
roots_gegenbauer
roots_sh_legendre
roots_sh_chebyt
roots_sh_chebyu
roots_sh_jacobi

The functions below, in turn, return the polynomial coefficients in orthopoly1d objects, which function similarly as numpy.poly1d. The orthopoly1d class also has an attribute weights which returns the roots, weights, and total weights for the appropriate form of Gaussian quadrature. These are returned in an n x 3 array with roots in the first column, weights in the second column, and total weights in the final column. Note that orthopoly1d objects are converted to poly1d when doing arithmetic, and lose information of the original orthogonal polynomial.

legendre
chebyt
chebyu
chebyc
chebys
jacobi
laguerre
genlaguerre
hermite
hermitenorm
gegenbauer
sh_legendre
sh_chebyt
sh_chebyu
sh_jacobi

Warning

Computing values of high-order polynomials (around order > 20) using polynomial coefficients is numerically unstable. To evaluate polynomial values, the eval_* functions should be used instead.

Hypergeometric Functions

hyp2f1
hyp1f1
hyperu
hyp0f1
hyp2f0
hyp1f2
hyp3f0

Parabolic Cylinder Functions

pbdv
pbvv
pbwa

These are not universal functions:

pbdv_seq
pbvv_seq
pbdn_seq

Spheroidal Wave Functions

pro_ang1
pro_rad1
pro_rad2
obl_ang1
obl_rad1
obl_rad2
pro_cv
obl_cv
pro_cv_seq
obl_cv_seq

The following functions require pre-computed characteristic value:

pro_ang1_cv
pro_rad1_cv
pro_rad2_cv
obl_ang1_cv
obl_rad1_cv
obl_rad2_cv

Kelvin Functions

kelvin
kelvin_zeros
ber
bei
berp
beip
ker
kei
kerp
keip

These are not universal functions:

ber_zeros
bei_zeros
berp_zeros
beip_zeros
ker_zeros
kei_zeros
kerp_zeros
keip_zeros

Combinatorics

comb
perm

Other Special Functions

agm
bernoulli
binom
diric
euler
expn
exp1
expi
factorial
factorial2
factorialk
shichi
sici
spence
zeta
zetac

Convenience Functions

cbrt
exp10
exp2
radian
cosdg
sindg
tandg
cotdg
log1p
expm1
cosm1
round
xlogy
xlog1py
logsumexp
exprel
sinc

Package Contents