পাইথন নামপাই-এর hermite_e.hermeval() মেথড ব্যবহার করে x পয়েন্টসে হারমাইট_ই সিরিজ মূল্যায়ন করা যায়। tensor=True হলে কোএফিশিয়েন্ট অ্যারের আকৃতি x-এর প্রতিটি ডাইমেনশনের জন্য ডান পাশে.ones দিয়ে এক্সটেন্ড হয়।
প্যারামিটারها
x: মূল্যায়ন পয়েন্ট। লিস্ট/টাপল হলে ndarray-এ কনভার্ট হয়।
C: কোএফিশিয়েন্ট অ্যারে, c[n]-এ ডিগ্রি n-এর কোএফিশিয়েন্ট থাকে।
tensor: True হলে (ডিফল্ট) কোএফিশিয়েন্ট অ্যারে এক্সটেন্ড হয়। False হলে x ব্রডকাস্ট হয়।
ধাপসমূহ
১. লাইব্রেরি ইম্পোর্ট
import numpy as np
from numpy.polynomial import hermite_e as H
২. মাল্টিডাইমেনশনাল কোএফিশিয়েন্ট অ্যারে তৈরি
c = np.arange(8).reshape(2,4)
৩. অ্যারে প্রদর্শন
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)
৭. হারমাইট_ই সিরিজ মূল্যায়ন করুন (tensor=True)
print("\nResult...\n", H.hermeval([1,2], c, tensor=True))
সম্পূর্ণ উদাহরণ
import numpy as np
from numpy.polynomial import hermite_e as H
c = np.arange(8).reshape(2,4)
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", H.hermeval([1,2], c, tensor=True))
আউটপুট
Our Array... [[0 1 2 3] [4 5 6 7]]
Dimensions of our Array... 2
Datatype of our Array object... int64
Shape of our Array object... (2, 4)
Result... [[ 4. 8.] [ 6. 11.] [ 8. 14.] [10. 17.]]