scipy.special — Special functions
The scipy.special submodule provides element-wise special
mathematical functions. Like the universal functions in
numpy, every routine accepts a scalar, a scalar-valued iterable
(range, list, tuple), or an numpy.ndarray, and
returns a new numpy.ndarray of dtype float.
Functions
- scipy.special.erf(x: ndarray | Iterable[float] | float) ndarray
Element-wise Gauss error function,
erf(x) = (2 / sqrt(pi)) * integral(exp(-t**2), 0, x).- Parameters:
x – a scalar, scalar-valued iterable, or
numpy.ndarray.- Returns:
a float
numpy.ndarraywith the same shape as the input.
- scipy.special.erfc(x: ndarray | Iterable[float] | float) ndarray
Element-wise complementary error function,
erfc(x) = 1 - erf(x), computed in a way that retains accuracy for large x.- Parameters:
x – a scalar, scalar-valued iterable, or
numpy.ndarray.- Returns:
a float
numpy.ndarraywith the same shape as the input.
- scipy.special.gamma(x: ndarray | Iterable[float] | float) ndarray
Element-wise Gamma function.
- Parameters:
x – a scalar, scalar-valued iterable, or
numpy.ndarray.- Returns:
a float
numpy.ndarraywith the same shape as the input.
- scipy.special.gammaln(x: ndarray | Iterable[float] | float) ndarray
Element-wise natural logarithm of the absolute value of the Gamma function.
- Parameters:
x – a scalar, scalar-valued iterable, or
numpy.ndarray.- Returns:
a float
numpy.ndarraywith the same shape as the input.