在Python中使用NumPy将赫米特数列与自变量相乘
在这篇文章中,我们将看到如何在Python中使用NumPy将Hermite数列乘以一个独立变量。
NumPy方法numpy.polynomial.hermite.hermmulx()用于将Hermite数列乘以x(自变量)得到一个新的数列。让我们了解一下这个方法的语法,以了解更多的信息。赫米特数列c与x相乘,其中x是自变量。
语法: numpy.polynomial.hermite.hermmulx(c)
参数:
- c : 类似数组的对象。赫米特级数的系数被安排在一个从低到高的一维阵列中。
返回:out:类似对象的数组。乘法的结果由一个数组表示。
示例 1:
在这个例子中,我们使用np.array()方法创建了一个代表系数的复数数组。数组的形状由.shape属性定义,数组的尺寸由.ndim定义,数组的数据类型由.dtype属性返回。numpy.polynomial.hermite.hermmulx(c)是用来将Hermite系列乘以单个变量的方法。
# import package import numpy as np # Creating an array of coefficients array = np.array([11, 12, 13]) print(array) # shape of the array is print("Shape of the array is : ", array.shape) # dimension of the array print("The dimension of the array is : ", array.ndim) # Datatype of the array print("Datatype of our Array is : ", array.dtype) # new array print("new array: ", np.polynomial.hermite.hermmulx(array))
输出:
[11 12 13] Shape of the array is : (3,) The dimension of the array is : 1 Datatype of our Array is : int64 new array: [12. 31.5 6. 6.5]
版权声明:本页面内容旨在传播知识,为用户自行发布,若有侵权等问题请及时与本网联系,我们将第一时间处理。E-mail:284563525@qq.com