Python Articles

Page 119 of 855

Evaluate a Hermite_e series at points x broadcast over the columns of the coefficient in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 203 Views

To evaluate a Hermite_e series at points x broadcast over the columns of coefficients, use the hermite_e.hermeval() method in NumPy. This function allows you to evaluate multiple polynomials simultaneously with different broadcasting behaviors. Syntax numpy.polynomial.hermite_e.hermeval(x, c, tensor=True) Parameters The function accepts three parameters: x − Points at which to evaluate the series. Can be a scalar, list, or array. c − Array of coefficients where coefficients for degree n are in c[n]. For multidimensional arrays, columns represent different polynomials. tensor − Boolean flag controlling broadcasting behavior. When False, x is broadcast over ...

Read More

Integrate a Legendre series over specific axis in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 254 Views

To integrate a Legendre series, use the polynomial.legendre.legint() method in Python. The method returns the Legendre series coefficients c integrated m times from lbnd along the specified axis. At each iteration, the resulting series is multiplied by scl and an integration constant k is added. Syntax numpy.polynomial.legendre.legint(c, m=1, k=[], lbnd=0, scl=1, axis=0) Parameters The method accepts the following parameters ? c − Array of Legendre series coefficients. If multidimensional, different axes correspond to different variables m − Order of integration, must be positive (Default: 1) k − Integration constant(s). If empty list ...

Read More

Generate a Vandermonde matrix of the Hermite_e polynomial with complex array of points in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 196 Views

To generate a Vandermonde matrix of the Hermite_e polynomial, use the hermite_e.hermvander() function in Python NumPy. The method returns the pseudo-Vandermonde matrix where each row corresponds to a point in the input array, and each column corresponds to a polynomial degree. The shape of the returned matrix is x.shape + (deg + 1, ), where the last index represents the degree of the corresponding Hermite polynomial. The dtype will be the same as the converted input array. Parameters x: Array of points. The dtype is converted to float64 or complex128 depending on whether any elements are complex. ...

Read More

Generate a Vandermonde matrix of the Hermite_e polynomial with float array of points in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 178 Views

To generate a Vandermonde matrix of the Hermite_e polynomial with a float array of points, use the numpy.polynomial.hermite_e.hermevander() function. This function returns a pseudo-Vandermonde matrix where each column represents a different degree of the Hermite_e polynomial evaluated at the input points. The Hermite_e polynomials (also called "physicists' Hermite polynomials") are orthogonal polynomials commonly used in quantum mechanics and probability theory. The Vandermonde matrix is useful for polynomial fitting and interpolation. Syntax numpy.polynomial.hermite_e.hermevander(x, deg) Parameters x: Array of points. The dtype is converted to float64 or complex128 depending on whether any elements are complex. ...

Read More

Return the Nuclear Norm of the matrix in Linear Algebra in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 539 Views

The Nuclear Norm (also known as the trace norm or Schatten 1-norm) is the sum of singular values of a matrix. In Python NumPy, use numpy.linalg.norm() with ord='nuc' parameter to calculate the nuclear norm of a matrix. Syntax numpy.linalg.norm(x, ord='nuc') Parameters x − Input array (must be 2-D for nuclear norm) ord − Order of the norm. Use 'nuc' for nuclear norm What is Nuclear Norm? The nuclear norm of a matrix is the sum of its singular values. It's commonly used in matrix completion and low-rank matrix approximation problems. ...

Read More

Return the Frobenius Norm of the matrix in Linear Algebra in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 2K+ Views

The Frobenius norm is a matrix norm that calculates the square root of the sum of squares of all elements in a matrix. In Python, use numpy.linalg.norm() with ord='fro' parameter to compute the Frobenius norm. Syntax numpy.linalg.norm(x, ord='fro') Parameters: x − Input matrix (2-D array) ord − Order of the norm. Use 'fro' for Frobenius norm How Frobenius Norm Works The Frobenius norm is calculated as: ||A|| F = √ Σ Σ |a ij ...

Read More

Integrate a Legendre series and multiply the result by a scalar before the integration constant is added in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 191 Views

To integrate a Legendre series and multiply the result by a scalar before adding the integration constant, use the polynomial.legendre.legint() method in Python. This method integrates Legendre series coefficients and allows scaling at each iteration before adding integration constants. Syntax numpy.polynomial.legendre.legint(c, m=1, k=[], lbnd=0, scl=1, axis=0) Parameters c − Array of Legendre series coefficients m − Order of integration (default: 1) k − Integration constant(s) (default: []) lbnd − Lower bound of integral (default: 0) scl − Scalar multiplier applied before adding integration constant (default: 1) axis − Axis over which integration is ...

Read More

Integrate a Legendre series and set the lower bound of the integral in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 228 Views

To integrate a Legendre series, use the polynomial.legendre.legint() method in Python. This method returns the Legendre series coefficients integrated m times from the lower bound (lbnd) along the specified axis. At each iteration, the resulting series is multiplied by a scaling factor and an integration constant is added. Syntax numpy.polynomial.legendre.legint(c, m=1, k=[], lbnd=0, scl=1, axis=0) Parameters Parameter Description Default c Array of Legendre series coefficients Required m Order of integration (must be positive) 1 k Integration constant(s) [] lbnd Lower bound of the integral ...

Read More

Integrate a Legendre series and set the integration constant in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 193 Views

To integrate a Legendre series in Python, use the polynomial.legendre.legint() method from NumPy. This method integrates Legendre series coefficients and allows you to set integration constants, making it useful for solving differential equations and polynomial manipulations. Syntax numpy.polynomial.legendre.legint(c, m=1, k=[], lbnd=0, scl=1, axis=0) Parameters The legint() method accepts the following parameters: c: Array of Legendre series coefficients m: Order of integration (default: 1) k: Integration constant(s). Use a scalar for single integration or a list for multiple integrations (default: []) lbnd: Lower bound of the integral (default: 0) scl: Scaling factor applied ...

Read More

Differentiate a Legendre series and multiply each differentiation by a scalar in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 221 Views

To differentiate a Legendre series, use the polynomial.legendre.legder() method in Python. This function returns the Legendre series coefficients differentiated m times along axis, with each differentiation multiplied by a scalar. Syntax numpy.polynomial.legendre.legder(c, m=1, scl=1, axis=0) Parameters The function accepts the following parameters ? c ? Array of Legendre series coefficients. If multidimensional, different axes correspond to different variables m ? Number of derivatives taken, must be non-negative (Default: 1) scl ? Scalar multiplier. Each differentiation is multiplied by scl, resulting in multiplication by scl**m (Default: 1) axis ? Axis over which the ...

Read More
Showing 1181–1190 of 8,549 articles
« Prev 1 117 118 119 120 121 855 Next »
Advertisements