लीजेंड्रे श्रृंखला c को x से गुणा करने के लिए, जहां x स्वतंत्र चर है, Python Numpy में thepolynomial.laguerre.legmulx() विधि का उपयोग करें। विधि गुणन के परिणाम का प्रतिनिधित्व करने वाली एक सरणी देता है। दो लीजेंड्रे श्रृंखला c1 - c2 का अंतर देता है। तर्क निम्नतम क्रम पद से उच्चतम तक क्रमित गुणांकों के अनुक्रम हैं, अर्थात, [1,2,3] सिद्धांत P_0 + 2*P_1 + 3*P_2 का प्रतिनिधित्व करता है। पैरामीटर, c एक 1-डी सरणी है जिसमें लीजेंड्रे श्रृंखला के गुणांक निम्न से उच्च तक क्रमबद्ध हैं।
कदम
सबसे पहले, आवश्यक पुस्तकालय आयात करें -
import numpy as np from numpy.polynomial import laguerre as L
एक सरणी बनाएं -
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) लीजेंड्रे श्रृंखला c को x से गुणा करने के लिए, जहां x स्वतंत्र चर है, Python Numpy में thepolynomial.laguerre.legmulx() विधि का उपयोग करें -
print("\nResult....\n",L.legmulx(c)) उदाहरण
import numpy as np
from numpy.polynomial import legendre as L
# Create an array
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)
# To multiply the Legendre series c by x, where x is the independent variable, use the polynomial.laguerre.legmulx() method in Python Numpy
print("\nResult....\n",L.legmulx(c)) आउटपुट
Our Array... [1 2 3] Dimensions of our Array... 1 Datatype of our Array object... int64 Shape of our Array object... (3,) Result.... [0.66666667 2.2 1.33333333 1.8 ]