Hermite_e পলিনোমিয়ালের ভ্যান্ডারমন্ড ম্যাট্রিক্স জেনারেট করতে, Python NumPy-এ hermite_e.hermevander() ব্যবহার করুন। মেথডটি ছদ্ম-ভ্যান্ডারমন্ড ম্যাট্রিক্স রিটার্ন করে। রিটার্ন করা ম্যাট্রিক্সের শেপ হলো x.shape + (deg + 1,), যেখানে লাস্ট ইনডেক্স হলো সংশ্লিষ্ট Hermite_e পলিনোমিয়ালের ডিগ্রি। dtype হবে কনভার্টেড x-এর মতোই।
প্যারামিটার x পয়েন্টের অ্যারে রিটার্ন করে। dtype কনভার্ট করা হয় float64 বা complex128-এ এই बातের উপর নির্ভর করে যে কোথাও কমপ্লেক্স এলিমেন্ট আছে কিনা। যদি x স্কেলার হয়, তবে এটি 1-D অ্যারেতে কনভার্ট করা হয়। প্যারামিটার deg হলো ফলাফল ম্যাট্রিক্সের ডিগ্রি।
ধাপসমূহ
প্রথমে প্রয়োজনীয় লাইব্রেরি ইমপোর্ট করুন −
import numpy as np
from numpy.polynomial import hermite_e as H
একটি অ্যারে তৈরি করুন −
x = np.array([0, 1, -1, 2])
অ্যারে ডিসপ্লে করুন −
print("Our Array...\n", x)
ডাইমেনশন চেক করুন −
print("\nDimensions of our Array...\n", x.ndim)
ডেটা টাইপ পান −
print("\nDatatype of our Array object...\n", x.dtype)
শেপ পান −
print("\nShape of our Array object...\n", x.shape)
Hermite_e পলিনোমিয়ালের ভ্যান্ডারমন্ড ম্যাট্রিক্স জেনারেট করতে, Python NumPy-এ hermite_e.hermevander() ব্যবহার করুন −
print("\nResult...\n", H.hermevander(x, 2))
উদাহরণ
import numpy as np
from numpy.polynomial import hermite_e as H
# Create an array
x = np.array([0, 1, -1, 2])
# Display the array
print("Our Array...\n", x)
# Check the Dimensions
print("\nDimensions of our Array...\n", x.ndim)
# Get the Datatype
print("\nDatatype of our Array object...\n", x.dtype)
# Get the Shape
print("\nShape of our Array object...\n", x.shape)
# To generate a Vandermonde matrix of the Hermite_e polynomial
print("\nResult...\n", H.hermevander(x, 2))
আউটপুট
Our Array... [ 0 1 -1 2]
Dimensions of our Array... 1
Datatype of our Array object... int64
Shape of our Array object... (4,)
Result... [[ 1. 0. -1.]
[ 1. 1. 0.]
[ 1. -1. 0.]
[ 1. 2. 3.]]