Numpy Articles

Page 28 of 81

Generate a Vandermonde matrix of the Chebyshev polynomial in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 289 Views

To generate a Vandermonde matrix of the Chebyshev polynomial, use the chebyshev.chebvander() function in NumPy. The method returns the Vandermonde matrix where each column represents a different degree of the Chebyshev polynomial. The shape of the returned matrix is x.shape + (deg + 1, ), where the last index corresponds to the degree of the Chebyshev polynomial. The function takes two parameters: x is an array of points (converted to float64 or complex128), and deg is the degree of the resulting matrix. Syntax numpy.polynomial.chebyshev.chebvander(x, deg) Parameters x: Array of points. The dtype is ...

Read More

Compute the roots of a Chebyshev series with given complex roots in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 228 Views

To compute the roots of a Chebyshev series, use the chebyshev.chebroots() method in Python NumPy. The method returns an array of the roots of the series. If all the roots are real, then the output is also real, otherwise it is complex. The parameter c is a 1-D array of coefficients. The root estimates are obtained as the eigenvalues of the companion matrix. Roots far from the origin of the complex plane may have large errors due to the numerical instability of the series for such values. Roots with multiplicity greater than 1 will also show larger errors as ...

Read More

Generate a Chebyshev series with given complex roots in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 272 Views

To generate a Chebyshev series with given complex roots, use the chebyshev.chebfromroots() method in NumPy. The method returns a 1-D array of coefficients. If all roots are real then the output is a real array; if some of the roots are complex, then the output is complex even if all coefficients in the result are real. Syntax numpy.polynomial.chebyshev.chebfromroots(roots) Parameters roots − A sequence containing the roots from which to generate the Chebyshev series. Example with Complex Roots Let's generate a Chebyshev series using complex roots -j and j where j is the ...

Read More

Evaluate a 2-D Hermite series on the Cartesian product of x and y with 1d array of coefficient in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 185 Views

To evaluate a 2-D Hermite series on the Cartesian product of x and y, use the hermite.hermgrid2d(x, y, c) method in Python. This method returns the values of the two-dimensional polynomial at points in the Cartesian product of x and y. Syntax numpy.polynomial.hermite.hermgrid2d(x, y, c) Parameters x, y: The two-dimensional series is evaluated at the points in the Cartesian product of x and y. If x or y is a list or tuple, it is first converted to an ndarray, otherwise it is left unchanged and, if it isn't an ndarray, it is ...

Read More

Evaluate a 2-D Hermite series on the Cartesian product of x and y with 3d array of coefficient in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 200 Views

To evaluate a 2-D Hermite series on the Cartesian product of x and y, use the hermite.hermgrid2d(x, y, c) method in Python. The method returns the values of the two-dimensional polynomial at points in the Cartesian product of x and y. Syntax numpy.polynomial.hermite.hermgrid2d(x, y, c) Parameters The parameters are: x, y − The two dimensional series is evaluated at the points in the Cartesian product of x and y. If x or y is a list or tuple, it is first converted to an ndarray, otherwise it is left unchanged and, if ...

Read More

Add one Laguerre series to another in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 211 Views

To add one Laguerre series to another, use the polynomial.laguerre.lagadd() method in Python NumPy. The method returns an array representing the Laguerre series of their sum. The function performs element-wise addition of Laguerre series coefficients. The arguments are sequences of coefficients ordered from lowest order term to highest, i.e., [1, 2, 3] represents the series P_0 + 2*P_1 + 3*P_2. The parameters c1 and c2 are 1-D arrays of Laguerre series coefficients ordered from low to high. Syntax numpy.polynomial.laguerre.lagadd(c1, c2) Parameters: c1, c2 − 1-D arrays of Laguerre series coefficients ordered from low ...

Read More

Convert a polynomial to Hermite series in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 311 Views

To convert a polynomial to a Hermite series, use the hermite.poly2herm() method in NumPy. This function converts an array representing polynomial coefficients (ordered from lowest to highest degree) to the coefficients of an equivalent Hermite series. Syntax numpy.polynomial.hermite.poly2herm(pol) Parameters: pol − 1-D array containing polynomial coefficients ordered from lowest to highest degree Returns: 1-D array containing the coefficients of the equivalent Hermite series. Example Let's convert a polynomial with coefficients [1, 2, 3, 4, 5] to its Hermite series representation ? import numpy as np from numpy.polynomial import ...

Read More

Convert a Hermite series to a polynomial in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 392 Views

To convert a Hermite series to a polynomial, use the hermite.herm2poly() method in Python NumPy. This method converts an array representing the coefficients of a Hermite series, ordered from lowest degree to highest, to an array of the coefficients of the equivalent polynomial (relative to the "standard" basis) ordered from lowest to highest degree. The method returns a 1-D array containing the coefficients of the equivalent polynomial (relative to the "standard" basis) ordered from lowest order term to highest. The parameter c is a 1-D array containing the Hermite series coefficients, ordered from lowest order term to highest. ...

Read More

Remove small trailing coefficients from Hermite polynomial in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 200 Views

To remove small trailing coefficients from Hermite polynomial, use the hermite.hermtrim() method in Python NumPy. The method returns a 1-d array with trailing zeros removed. If the resulting series would be empty, a series containing a single zero is returned. The "Small" means "small in absolute value" and is controlled by the parameter tol; "trailing" means highest order coefficient(s), e.g., in [0, 1, 1, 0, 0] (which represents 0 + x + x**2 + 0*x**3 + 0*x**4) both the 3rd and 4th order coefficients would be "trimmed." Syntax numpy.polynomial.hermite.hermtrim(c, tol=0) Parameters c − ...

Read More

Get the Least squares fit of Hermite series to data in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 327 Views

To get the least squares fit of Hermite series to data, use the hermite.hermfit() method in Python NumPy. This method fits a Hermite polynomial series to given data points and returns the Hermite coefficients ordered from low to high. Syntax numpy.polynomial.hermite.hermfit(x, y, deg, rcond=None, full=False, w=None) Parameters The key parameters are ? x ? x-coordinates of the sample (data) points y ? y-coordinates of the sample points deg ? Degree of the fitting polynomial rcond ? Relative condition number for singular values full ? When True, returns diagnostic information along with coefficients ...

Read More
Showing 271–280 of 802 articles
« Prev 1 26 27 28 29 30 81 Next »
Advertisements