Docs/Scientific Computing (SciPy)

Scientific Computing (SciPy)

SciPy-inspired scientific computing library with optimization, integration, linear algebra, and statistics.

sp.integrate.quad
Compute a definite integral using adaptive quadrature.
sp.integrate.quad(func, a, b, options?)
sp.linalg.inv
Compute the inverse of a sparse matrix.
sp.linalg.inv(A, options?)
sp.linalg.spilu
Compute incomplete LU factorization for use as a preconditioner.
sp.linalg.spilu(A, options?)
sp.linalg.splu
Compute sparse LU decomposition of matrix A.
sp.linalg.splu(A, options?)
sp.linalg.spsolve
Solve the sparse linear system A @ x = b using SuperLU.
sp.linalg.spsolve(A, b, options?)
sp.linalg.eigs
Find k eigenvalues and eigenvectors of a square matrix A.
sp.linalg.eigs(A, k?, options?)
sp.linalg.eigsh
Find k eigenvalues and eigenvectors of the real symmetric square matrix A.
sp.linalg.eigsh(A, k?, options?)
sp.linalg.svds
Compute the truncated SVD of a sparse matrix.
sp.linalg.svds(A, k?, options?)
sp.linalg.expm
Compute the matrix exponential of a sparse matrix.
sp.linalg.expm(A, _options?)
sp.linalg.expm_multiply
Compute the action of the matrix exponential on a vector: exp(t*A) * v
sp.linalg.expm_multiply(A, v, options?)
sp.linalg.aslinearoperator
Convert various types to a LinearOperator
sp.linalg.aslinearoperator(A)
sp.linalg.isLinearOperator
Check if a value is a LinearOperator
sp.linalg.isLinearOperator(x)
sp.linalg.bicgstab
BiConjugate Gradient Stabilized method for solving Ax = b
sp.linalg.bicgstab(A, b, options?)
sp.linalg.cg
Conjugate Gradient method for solving Ax = b
sp.linalg.cg(A, b, options?)
sp.linalg.gmres
GMRES (Generalized Minimal Residual) method for solving Ax = b
sp.linalg.gmres(A, b, options?)
sp.linalg.norm
Sparse matrix or vector norm
sp.linalg.norm(x, ord?)
sp.optimize.minimize
Minimization of scalar function of one or more variables.
sp.optimize.minimize(fun, x0, options?)
sp.sparse.bsr_matrix
Factory function to create a BSR matrix
sp.sparse.bsr_matrix(arg, options?)
sp.sparse.block_diag
Build a block diagonal sparse matrix from provided matrices.
sp.sparse.block_diag(mats, format?)
sp.sparse.diags
Construct a sparse matrix from diagonals.
sp.sparse.diags(diagonals, offsets?, shape?, format?)
sp.sparse.eye
Sparse identity matrix.
sp.sparse.eye(m, n?, k?, format?)
sp.sparse.hstack
Stack sparse matrices horizontally (column-wise).
sp.sparse.hstack(blocks, format?)
sp.sparse.issparse
Check if x is a sparse matrix.
sp.sparse.issparse(x)
sp.sparse.kron
Kronecker product of sparse matrices.
sp.sparse.kron(A, B, format?)
sp.sparse.kronsum
Kronecker sum of sparse matrices.
sp.sparse.kronsum(A, B, format?)
sp.sparse.random
Generate a sparse matrix with uniformly distributed random values.
sp.sparse.random(m, n, density?, format?, rng?)
sp.sparse.tril
Return the lower triangular portion of a sparse matrix.
sp.sparse.tril(A, k?, format?)
sp.sparse.triu
Return the upper triangular portion of a sparse matrix.
sp.sparse.triu(A, k?, format?)
sp.sparse.vstack
Stack sparse matrices vertically (row-wise).
sp.sparse.vstack(blocks, format?)
sp.sparse.coo_matrix
Factory function to create a COO matrix
sp.sparse.coo_matrix(arg, options?)
sp.sparse.csc_matrix
csc_matrix
sp.sparse.csc_matrix(arg, options?)
sp.sparse.csr_matrix
csr_matrix
sp.sparse.csr_matrix(arg, options?)
sp.sparse.dia_matrix
Factory function to create a DIA matrix
sp.sparse.dia_matrix(arg, options?)
sp.sparse.dok_matrix
Factory function to create a DOK matrix
sp.sparse.dok_matrix(arg, options?)
sp.sparse.lil_matrix
Factory function to create a LIL matrix
sp.sparse.lil_matrix(arg, options?)
sp.sparse.aslinearoperator
Convert various types to a LinearOperator
sp.sparse.aslinearoperator(A)
sp.sparse.bicgstab
BiConjugate Gradient Stabilized method for solving Ax = b
sp.sparse.bicgstab(A, b, options?)
sp.sparse.cg
Conjugate Gradient method for solving Ax = b
sp.sparse.cg(A, b, options?)
sp.sparse.gmres
GMRES (Generalized Minimal Residual) method for solving Ax = b
sp.sparse.gmres(A, b, options?)
sp.sparse.isLinearOperator
Check if a value is a LinearOperator
sp.sparse.isLinearOperator(x)
sp.sparse.linalg_norm
Sparse matrix or vector norm
sp.sparse.linalg_norm(x, ord?)
sp.special.i0
Modified Bessel function of the first kind, order 0: I₀(x)
sp.special.i0(x)
sp.special.i1
Modified Bessel function of the first kind, order 1: I₁(x)
sp.special.i1(x)
sp.special.iv
Modified Bessel function of the first kind, order v: Iᵥ(x)
sp.special.iv(v, x)
sp.special.j0
Bessel functions via WebAssembly.
sp.special.j0(x)
sp.special.j1
Bessel function of the first kind, order 1: J₁(x)
sp.special.j1(x)
sp.special.jv
Bessel function of the first kind, order v: Jᵥ(x)
sp.special.jv(v, x)
sp.special.k0
Modified Bessel function of the second kind, order 0: K₀(x)
sp.special.k0(x)
sp.special.k1
Modified Bessel function of the second kind, order 1: K₁(x)
sp.special.k1(x)
sp.special.y0
Bessel function of the second kind, order 0: Y₀(x)
sp.special.y0(x)
sp.special.y1
Bessel function of the second kind, order 1: Y₁(x)
sp.special.y1(x)
sp.special.yv
Bessel function of the second kind, order v: Yᵥ(x)
sp.special.yv(v, x)
sp.special.beta
Beta function and related special functions via WebAssembly.
sp.special.beta(a, b)
sp.special.betaln
Natural logarithm of the beta function: ln(B(a, b))
sp.special.betaln(a, b)
sp.special.comb
Binomial coefficient (N choose k).
sp.special.comb(N, k, options?)
sp.special.erf
Error functions via WebAssembly.
sp.special.erf(x)
sp.special.erfc
Complementary error function: erfc(x) = 1 - erf(x)
sp.special.erfc(x)
sp.special.erfcx
Scaled complementary error function: erfcx(x) = e^(x²) * erfc(x)
sp.special.erfcx(x)
sp.special.erfi
Imaginary error function: erfi(x) = -i * erf(ix)
sp.special.erfi(x)
sp.special.factorial
The factorial of a number or array of numbers.
sp.special.factorial(n, options?)
sp.special.factorial2
Double factorial.
sp.special.factorial2(n, options?)
sp.special.factorialk
Multifactorial of n of order k, n(!!...!).
sp.special.factorialk(n, k, options?)
sp.special.gamma
Gamma function and related special functions via WebAssembly.
sp.special.gamma(x)
sp.special.gammaln
Natural logarithm of the absolute value of the gamma function.
sp.special.gammaln(x)
sp.special.rgamma
Reciprocal of the gamma function: 1/Γ(x)
sp.special.rgamma(x)
sp.special.perm
Permutations (k-permutations of N).
sp.special.perm(N, k, options?)
sp.stats.describe
Compute several descriptive statistics of the passed array.
sp.stats.describe(a, options?)
sp.stats.kurtosis
Compute the kurtosis (Fisher or Pearson) of a dataset.
sp.stats.kurtosis(a, axis?, fisher?, bias?)
sp.stats.moment
Compute the nth central moment of the data along the given axis.
sp.stats.moment(a, order?, axis?)
sp.stats.skew
Compute the sample skewness of a data set.
sp.stats.skew(a, axis?, bias?)
sp.configureWasm
configureWasm
sp.configureWasm(config)
sp.isWasmLoaded
isWasmLoaded
sp.isWasmLoaded()
sp.loadWasmModule
loadWasmModule
sp.loadWasmModule()
sp.resetWasmModule
resetWasmModule
sp.resetWasmModule()