- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 10784 Articles for Python
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
246 Views
To get the Inner product of two arrays, use the numpy.inner() method in Python. Ordinary inner product of vectors for 1-D arrays, in higher dimensions a sum product over the last axes. The parameters are 1 and b, two vectors. If a and b are nonscalar, their last dimensions must match.StepsAt first, import the required libraries −import numpy as npCreating two numpy One-Dimensional array using the array() method −arr1 = np.arange(2).reshape((1, 1, 2)) arr2 = np.arange(6).reshape((3, 2))Display the arrays −print("Array1...", arr1) print("Array2...", arr2)Check the Dimensions of both the arrays −print("Dimensions of Array1...", arr1.ndim) print("Dimensions of Array2...", arr2.ndim)Check the Shape of ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
144 Views
To get the Outer product of an array and a scalar, use the numpy.outer() method in Python. The 1st parameter a is the first input vector. Input is flattened if not already 1-dimensional. The 2nd parameter b is the second input vector. Input is flattened if not already 1-dimensional. The 3rd parameter out is a location where the result is stored.Given two vectors, a = [a0, a1, ..., aM] and b = [b0, b1, ..., bN], the outer product is −[[a0*b0 a0*b1 ... a0*bN ] [a1*b0 . [ ... . [aM*b0 aM*bN ]]StepsAt first, import the required ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
87 Views
Given two vectors, a = [a0, a1, ..., aM] and b = [b0, b1, ..., bN], the outer product is −[[a0*b0 a0*b1 ... a0*bN ] [a1*b0 . [ ... . [aM*b0 aM*bN ]]To get the Outer product of an array with vector of letters, use the numpy.outer() method in Python. The 1st parameter a is the first input vector. Input is flattened if not already 1-dimensional. The 2nd parameter b is the second input vector. Input is flattened if not already 1-dimensional. The 3rd parameter out is a location where the result is storedStepsAt first, import ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
146 Views
Given two vectors, a = [a0, a1, ..., aM] and b = [b0, b1, ..., bN], the outer product [1] is −[[a0*b0 a0*b1 ... a0*bN ] [a1*b0 . [ ... . [aM*b0 aM*bN ]]To get the Outer product of two arrays, use the numpy.outer() method in Python. The numpy.ones() return a new array of given shape and type, filled with ones. The numpy.linspace() returns evenly spaced numbers over a specified interval.StepsAt first, import the required libraries −import numpy as np The real part −rl = np.outer(np.ones((5, )), np.linspace(-2, 2, 5)) print("The real part of the complex number...", ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
327 Views
To get the Outer product of two One-Dimensional arrays, use the numpy.outer() method in Python. The 1st parameter a is the first input vector. Input is flattened if not already 1-dimensional. The 2nd parameter b is the second input vector. Input is flattened if not already 1-dimensional. The 3rd parameter out is a location where the result is stored.Given two vectors, a = [a0, a1, ..., aM] and b = [b0, b1, ..., bN], the outer product [1] is −[[a0*b0 a0*b1 ... a0*bN ] [a1*b0 . [ ... . [aM*b0 aM*bN ]]StepsAt first, import the required libraries ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
440 Views
To get the Outer product of two multi-dimensional arrays, use the numpy.outer() method in Python. The 1st parameter a is the first input vector. Input is flattened if not already 1-dimensional. The 2nd parameter b is the second input vector. Input is flattened if not already 1-dimensional. The 3rd parameter out is a location where the result is stored.Given two vectors, a = [a0, a1, ..., aM] and b = [b0, b1, ..., bN], the outer product [1] is −[[a0*b0 a0*b1 ... a0*bN ] [a1*b0 . [ ... . [aM*b0 aM*bN ]]StepsAt first, import the required libraries ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
138 Views
To Compute the sign and natural logarithm of the determinant of an array, use the numpy.linalg.slogdet() method in Python. The 1st parameter, s is an input array, has to be a square 2-D array.The method, with sign returns a number representing the sign of the determinant. For a real matrix, this is 1, 0, or -1. For a complex matrix, this is a complex number with absolute value 1, or else 0. The method, with logdet returns the natural log of the absolute value of the determinant. If the determinant is zero, then sign will be 0 and logdet will ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
98 Views
To return the cumulative product of array elements over a given axis treating NaNs as one, use the nancumprod() method. The cumulative product does not change when NaNs are encountered and leading NaNs are replaced by ones. Ones are returned for slices that are all-NaN or empty.The method returns a new array holding the result is returned unless out is specified, in which case it is returned. Cumulative works like, 5, 5*10, 5*10*15, 5*10*15*20. The 1st parameter is the input array. The 2nd parameter is the Axis along which the cumulative product is computed. By default the input is flattened.The ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
105 Views
To return the cumulative product of array elements over a given axis treating NaNs as one, use the nancumprod() method. The cumulative product does not change when NaNs are encountered and leading NaNs are replaced by ones. Ones are returned for slices that are all-NaN or empty. The method returns a new array holding the result is returned unless out is specified, in which case it is returned.Cumulative works like, 5, 5*10, 5*10*15, 5*10*15*20. The 1st parameter is the input array. The 2nd parameter is the Axis along which the cumulative product is computed. By default the input is flattened. ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
108 Views
To integrate a Laguerre series, use the laguerre.lagint() method in Python. The method returns the Laguerre series coefficients c integrated m times from lbnd along axis. At each iteration the resulting series is multiplied by scl and an integration constant, k, is added. The scaling factor is for use in a linear change of variable.The 1st parameter, c is an array of Laguerre series coefficients. If c is multidimensional the different axis correspond to different variables with the degree in each axis given by the corresponding index. The 2nd parameter, m is an order of integration, must be positive. (Default: ... Read More