কম্পিউটার টিউটোরিয়াল

পাইথনে একটি হারমাইট_ই সিরিজকে অন্যদিকে গুণ করা


পাইথন নামপাই-এর hermite_e.hermemul() মেথড ব্যবহার করে একটি হারমাইট_ই সিরিজকে অন্যদিকে গুণ করা যায়। এটি তাদের গুণফলের হারমাইট_ই সিরিজ রিপ্রেজেন্ট করা অ্যারে রিটার্ন করে।

প্যারামিটারها

c1, c2: হারমাইট_ই সিরিজ কোএফিশিয়েন্টের ১-D অ্যারে, নিম্ন থেকে উচ্চ অর্ডারে।

ধাপসমূহ

১. লাইব্রেরি ইম্পোর্ট

import numpy as np
from numpy.polynomial import hermite_e as H

২. কোএফিশিয়েন্ট অ্যারে তৈরি

c1 = np.array([1, 2, 3])
c2 = np.array([3, 2, 1])

৩. অ্যারে প্রদর্শন

print("Array1...\n", c1)
print("\nArray2...\n", c2)

৪. ডাটা টাইপ চেক

print("\nArray1 datatype...\n", c1.dtype)
print("\nArray2 datatype...\n", c2.dtype)

৫. ডাইমেনশন চেক

print("\nDimensions of Array1...\n", c1.ndim)
print("\nDimensions of Array2...\n", c2.ndim)

৬. শেপ চেক

print("\nShape of Array1...\n", c1.shape)
print("\nShape of Array2...\n", c2.shape)

৭. হারমাইট_ই সিরিজ গুণ করুন

print("\nResult (multiply)....\n", H.hermemul(c1, c2))

সম্পূর্ণ উদাহরণ

import numpy as np
from numpy.polynomial import hermite_e as H

c1 = np.array([1, 2, 3])
c2 = np.array([3, 2, 1])

print("Array1...\n", c1)
print("\nArray2...\n", c2)
print("\nArray1 datatype...\n", c1.dtype)
print("\nArray2 datatype...\n", c2.dtype)
print("\nDimensions of Array1...\n", c1.ndim)
print("\nDimensions of Array2...\n", c2.ndim)
print("\nShape of Array1...\n", c1.shape)
print("\nShape of Array2...\n", c2.shape)
print("\nResult (multiply)....\n", H.hermemul(c1, c2))

আউটপুট

Array1...   [1 2 3]
Array2...   [3 2 1]
Array1 datatype... int64
Array2 datatype... int64
Dimensions of Array1... 1
Dimensions of Array2... 1
Shape of Array1... (3,)
Shape of Array2... (3,)
Result (multiply)....   [13. 24. 26. 8. 3.]
  1. পাইথনে একটি চেবিশেভ সিরিজকে অন্যটি থেকে বিয়োগ করা

  2. পাইথনে একটি চেবিশেভ সিরিজকে অন্যটির সাথে যোগ করা

  3. পাইথনে একটি পলিনোমিয়ালকে অন্যটির সাথে গুণ করুন

  4. Python - একটি লিস্টে অন্য লিস্টের প্রথম অকারেন্স খুঁজে বের করা