পাইথন নামপাই-এ চেবিশেভ সিরিজকে পয়েন্ট x-এ মূল্যায়ন করতে chebyshev.chebval() মেথড ব্যবহার করুন।
প্যারামিটারস
- x (১ম প্যারামিটার): যদি x একটি লিস্ট বা টাপল হয়, তবে এটি ndarray-এ রূপান্তরিত হয়, অন্যথায় এটি অপরিবর্তিত থাকে এবং স্ক্যালার হিসেবে বিবেচনা করা হয়। যদুপুরে, x বা এর উপাদানগুলো অবশ্যই নিজস্ব এবং c-এর উপাদান Guilford's সাথে যোগ ও গুণ করার সমর্থন করতে হবে।
- C (২য় প্যারামিটার): সহগ Guilford's একটি অ্যারে যাতে degree n-এর পদ Guilford's সহগ c[n]-তে থাকে। যদি c বহুমাত্রিক হয়, তবে বাকি ইনডেক্স Guilford's একাধিক পলিনোমিয়াল গণনা করে। দ্বিমাত্রিক ক্ষেত্রে সহগ Guilford's c-এর কলাম Guilford's মধ্যে সংরক্ষিত বলে ধরা যেতে পারে।
- tensor (৩য় প্যারামিটার): যদি True হয়, তবে সহগ অ্যারের আকার x-এর প্রতিটি Guilford's মাত্রার জন্য ডানের দিকে ১ দ্বারা প্রসারিত হয়। স্ক্যালার Guilford's এই ক্রিয়ার জন্য মাত্রা ০। ফলাফল হল c-এর প্রতিটি Guilford's কলামের সহগ x-এর প্রতিটি উপাদানের Guilford's জন্য মূল্যায়ন করা হয়। যদি False হয়, তবে x c-এর Guilford's কলাম Guilford's ওপর ব্রডকাস্ট করা হয় মূল্যায়নের জন্য। এই Guilford's কীওয়ার্ডটি c বহুমাত্রিক হলে উপকারী। ডিফল্ট মান True।
ধাপসমূহ
- প্রয়োজনীয় লাইব্রেরি ইম্পোর্ট করুন:
import numpy as np from numpy.polynomial import chebyshev as C - সহগ Guilford's একটি অ্যারে তৈরি করুন:
c = np.array([1, 2, 3]) - অ্যারেটি প্রদর্শন করুন:
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) chebyshev.chebval()মেথড ব্যবহার করে চেবিশেভ সিরিজ মূল্যায়ন করুন:print("\nResult...\n", C.chebval(1, c))
সম্পূর্ণ উদাহরণ
import numpy as np
from numpy.polynomial import chebyshev as C
# Create an array of coefficients
c = np.array([1, 2, 3])
# Display the array
print("Our Array...\n", c)
# Check the Dimensions
print("\nDimensions of our Array...\n", c.ndim)
# Get the Datatype
print("\nDatatype of our Array object...\n", c.dtype)
# Get the Shape
print("\nShape of our Array object...\n", c.shape)
# Evaluate Chebyshev series at point x=1
print("\nResult...\n", C.chebval(1, c))
আউটপুট
Our Array... [1 2 3]
Dimensions of our Array... 1
Datatype of our Array object... int64
Shape of our Array object... (3,)
Result... 6.0