एक लैगुएर श्रृंखला को दूसरी में जोड़ने के लिए, पायथन नम्पी में polynomial.laguerre.lagadd() विधि का उपयोग करें। यह विधि उनके योग को दर्शाने वाली लैगुएर श्रृंखला की सरणी लौटाती है।
दो लैगुएर श्रृंखला c1 + c2 का योग लौटाता है। तर्क निम्नतम क्रम के पद से उच्चतम तक क्रमबद्ध गुणांकों के अनुक्रम हैं, अर्थात [1,2,3] श्रृंखला P_0 + 2*P_1 + 3*P_2 को दर्शाता है। पैरामीटर c1 और c2 निम्न से उच्च क्रमित लैगुएर श्रृंखला गुणांकों की 1-डी सरणी हैं।
चरण
सबसे पहले, आवश्यक लाइब्रेरी आयात करें:
import numpy as np from numpy.polynomial import laguerre as L
लैगुएर श्रृंखला गुणांकों की 1-डी सरणियां बनाएं:
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)एक लैगुएर श्रृंखला को दूसरी में जोड़ने के लिए, polynomial.laguerre.lagadd() विधि का उपयोग करें:
print("\nResult (sum)....\n", L.lagadd(c1, c2))उदाहरण
import numpy as np from numpy.polynomial import laguerre as L # लैगुएर श्रृंखला गुणांकों की 1-डी सरणियां बनाएं 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) # एक लैगुएर श्रृंखला को दूसरी में जोड़ने के लिए polynomial.laguerre.lagadd() विधि का उपयोग करें print("\nResult (sum)....\n", L.lagadd(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 (sum).... [4. 4. 4.]