Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> Python

ประเมินอนุกรม Laguerre 2 มิติ ที่จุด (x,y) สัมประสิทธิ์ 1D ใน Python

บทนำ

เมธอด laguerre.lagval2d() ประเมินอนุกรม Laguerre 2 มิติ ที่จุด (x, y) รองรับสัมประสิทธิ์ 1 มิติ (ขยายเป็น 2 มิติอัตโนมัติ)

ตัวอย่าง: สัมประสิทธิ์ 1 มิติ [3, 5]

import numpy as np
from numpy.polynomial import laguerre as L

c = np.array([3, 5])
print("Our Array...\n", c)
print("\nDimensions of our Array...\n", c.ndim)
print("\nDatatype of our Array object...\n", c.dtype)
print("\nShape of our Array object...\n", c.shape)

print("\nResult...\n", L.lagval2d([1, 2], [1, 2], c))

ผลลัพธ์

Our Array... [3 5]
Dimensions of our Array... 1
Datatype of our Array object... int64
Shape of our Array object... (2,)
Result... [3. 5.]

สัมประสิทธิ์ 1D [3,5] ถูกขยายเป็น 2D อัตโนมัติ ประเมินที่ (1,1) และ (2,2)