Numpy Articles

Page 29 of 81

Evaluate a 2-D Hermite series on the Cartesian product of x and y in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 176 Views

To evaluate a 2-D Hermite series on the Cartesian product of x and y, use the hermite.hermgrid2d() method in Python. This method evaluates a two-dimensional Hermite polynomial at points formed by the Cartesian product of input arrays. Syntax numpy.polynomial.hermite.hermgrid2d(x, y, c) Parameters The method accepts the following parameters: x, y − Input arrays. The two-dimensional series is evaluated at points in the Cartesian product of x and y. If x or y is a list or tuple, it is converted to an ndarray first c − Array of coefficients ordered so that ...

Read More

Evaluate a 2-D Hermite series at points (x,y) in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 205 Views

To evaluate a 2D Hermite series at points (x, y), use the hermite.hermval2d() method in NumPy. The method returns the values of the two-dimensional polynomial at points formed with pairs of corresponding values from x and y. Syntax numpy.polynomial.hermite.hermval2d(x, y, c) Parameters The function accepts three parameters ? x, y − The two-dimensional series is evaluated at points (x, y), where x and y must have the same shape. If x or y is a list or tuple, it is first converted to an ndarray. c − Array of coefficients ordered so ...

Read More

Evaluate a Hermite series at points x with multidimensional coefficient array in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 180 Views

To evaluate a Hermite series at points x with a multidimensional coefficient array, use the hermite.hermval() method in NumPy. This function allows you to compute Hermite polynomial values efficiently with complex coefficient structures. Syntax numpy.polynomial.hermite.hermval(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: Coefficient array where c[n] contains coefficients for degree n terms tensor: Boolean flag controlling evaluation behavior (default: True) Basic Example Let's start with a simple multidimensional coefficient array ? ...

Read More

Evaluate a Hermite series at list of points x in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 251 Views

To evaluate a Hermite series at specific points, use NumPy's hermite.hermval() method. This function computes the value of a Hermite polynomial series at given x-coordinates using coefficient arrays. Syntax numpy.polynomial.hermite.hermval(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 c[n] contains coefficients for degree n terms. tensor: Boolean flag controlling evaluation behavior (default: True). Basic Example Let's evaluate a Hermite series with coefficients [1, 2, 3] at points [5, 10, ...

Read More

Evaluate a Hermite series at tuple of points x in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 201 Views

To evaluate a Hermite series at points x, use the hermite.hermval() method in Python NumPy. This function evaluates a Hermite polynomial series at given points using the coefficients provided. Syntax hermite.hermval(x, c, tensor=True) Parameters The function accepts three parameters ? x − If x is a list or tuple, it is converted to an ndarray, otherwise it is left unchanged and treated as a scalar. The elements must support addition and multiplication with themselves and with the elements of c. c − An array of coefficients ordered so that the coefficients for ...

Read More

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

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 204 Views

To evaluate a Hermite series at points x, use the hermite.hermval() method in Python NumPy. This function allows you to evaluate Hermite polynomials with broadcasting capabilities over coefficient arrays. Syntax numpy.polynomial.hermite.hermval(x, c, tensor=True) Parameters x: If x is a list or tuple, it is converted to an ndarray, otherwise it is left unchanged and treated as a scalar. The elements must support addition and multiplication with themselves and with the elements of c. c: An array of coefficients ordered so that the coefficients for terms of degree n are contained in c[n]. If ...

Read More

Add one Hermite series to another in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 185 Views

To add one Hermite series to another, use the polynomial.hermite.hermadd() method in Python NumPy. The method returns an array representing the Hermite series of their sum. Returns the sum of two Hermite series c1 + c2. 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 Hermite series coefficients ordered from low to high. Syntax numpy.polynomial.hermite.hermadd(c1, c2) Parameters c1, c2 − 1-D arrays of Hermite series coefficients ordered from ...

Read More

Return a boolean array which is True where the string element in array ends with suffix in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 230 Views

To return a boolean array which is True where the string element in array ends with a specific suffix, use the numpy.char.endswith() method. This function performs vectorized string operations on NumPy string arrays, checking each element for the specified suffix. Syntax numpy.char.endswith(a, suffix, start=0, end=None) Parameters a − Input array of strings suffix − String suffix to check for start − (Optional) Start position for checking end − (Optional) End position for checking Basic Example Let's create a string array and check which elements end with a specific suffix − ...

Read More

Get the Inner product of two arrays in Python

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

The inner product of two arrays is computed using NumPy's inner() method. For 1-D arrays, it calculates the ordinary inner product of vectors. For higher dimensions, it performs a sum product over the last axes. Syntax numpy.inner(a, b) Parameters: a, b − Input arrays. If non-scalar, their last dimensions must match Basic Inner Product Example Let's calculate the inner product of two 1-D arrays ? import numpy as np # Create two 1-D arrays arr1 = np.array([5, 10, 15]) arr2 = np.array([20, 25, 30]) print("Array1:", arr1) print("Array2:", ...

Read More

Return the result of the power to which the negative input value is raised with scimath in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 200 Views

To return the result of the power to which the input value is raised with scimath, use the numpy.emath.power() method in Python. This function computes x to the power p (x**p) and automatically converts negative values to the complex domain when necessary. The numpy.emath.power() function handles negative bases gracefully by returning complex numbers, unlike the regular numpy.power() which may produce warnings or errors with negative values. Syntax numpy.emath.power(x, p) Parameters x − The base value(s). Can be a scalar or array containing negative values. p − The exponent(s). If x contains multiple values, ...

Read More
Showing 281–290 of 802 articles
« Prev 1 27 28 29 30 31 81 Next »
Advertisements