Compute the inner product of vectors for 1-D arrays using NumPy in Python Last Updated : 29 Aug, 2020 Comments Improve Suggest changes Like Article Like Report Python has a popular package called NumPy which used to perform complex calculations on 1-D and multi-dimensional arrays. To find the inner product of two arrays, we can use the inner() function of the NumPy package. Syntax: numpy.inner(array1, array2) Parameters: array1, array2: arrays to be evaluated Returns: Inner Product of two arrays Example 1: Python3 # Importing library import numpy as np # Creating two 1-D arrays array1 = np.array([6,2]) array2 = np.array([2,5]) print("Original 1-D arrays:") print(array1) print(array2) # Output print("Inner Product of the two array is:") result = np.inner(array1, array2) print(result) Output: Original 1-D arrays: [6 2] [2 5] Inner Product of the two array is: 22 Example 2: Python3 # Importing library import numpy as np # Creating two 1-D arrays array1 = np.array([1,3,5]) array2 = np.array([0,1,5]) print("Original 1-D arrays:") print(array1) print(array2) # Output print("Inner Product of the two array is:") result = np.inner(array1, array2) print(result) Output: Original 1-D arrays: [1 3 5] [0 1 5] Inner Product of the two array is: 28 Example 3: Python3 # Importing library import numpy as np # Creating two 1-D arrays array1 = np.array([1,2,2,8]) array2 = np.array([2,1,0,6]) print("Original 1-D arrays:") print(array1) print(array2) # Output print("Inner Product of the two array is:") result = np.inner(array1, array2) print(result) Output: Original 1-D arrays: [1 2 2 8] [2 1 0 6] Inner Product of the two array is: 52 Comment More infoAdvertise with us Next Article Compute the inner product of vectors for 1-D arrays using NumPy in Python G geekmonkey Follow Improve Article Tags : Python Numpy Python-numpy Python numpy-Mathematical Function Practice Tags : python Similar Reads Get the Outer Product of an array with vector of letters using NumPy in Python In this article let's see how to get the outer product of an array with a vector of letters in Python. numpy.outer() method The numpy.outer() method is used to get the outer product of an array with a vector of elements in Python. A matrix is the outer product of two coordinate vectors in linear alg 4 min read How to compute the cross product of two given vectors using NumPy? Let's see the program to compute the cross product of two given vectors using NumPy. For finding the cross product of two given vectors we are using numpy.cross() function of NumPy library.Syntax: numpy.cross(a, b, axisa=-1, axisb=-1, axisc=-1, axis=None)[Return: cross product of two (arrays of) vec 1 min read Make grid for computing a Mandelbrot set with outer product using NumPy in Python In this article let's learn how to make a grid for computing a Mandelbrot set with an outer product in Numpy using Python. numpy.outer() method: In Python, the numpy.outer() method is used to acquire the outer product of an array and a vector of elements. In linear algebra, a matrix is the outer pr 4 min read Compute the determinant of a given square array using NumPy in Python In Python, the determinant of a square array can be easily calculated using the NumPy package. This package is used to perform mathematical calculations on single and multi-dimensional arrays. numpy.linalg is an important module of NumPy package which is used for linear algebra. We can use det() fun 2 min read Python Program to Get dot product of multidimensional Vectors using NumPy Given two multidimensional Vectors, the task is to write a Python program to get the dot product of two multidimensional Vectors using NumPy.Example: Lets take 2 vectors a = [2,5,3] and b = [6,3,1]Dot Product(ab) = (a[0] * b[0])+ (a[1] * b[1]) + (a[2] * b[2]) = (2*6)+ (5*3) + (3*1) = 30Dot Product i 3 min read How to Create Array of zeros using Numpy in Python numpy.zeros() function is the primary method for creating an array of zeros in NumPy. It requires the shape of the array as an argument, which can be a single integer for a one-dimensional array or a tuple for multi-dimensional arrays. This method is significant because it provides a fast and memory 4 min read Compute the Kronecker product of two multidimension NumPy arrays Given an m X n matrix A and a p X q matrix B, their Kronecker product is A â B, also called their matrix direct product, is an (m*p) X (n*q) matrix. A = |â(a00)ââ(a01)â|    â|â(a10)ââ(a11)â| B = |â(b00)ââ(b01)â|    â|â(b10)ââ(b11)â| A â B = |â(a00)*(b00)ââ(a00)*(b01)ââ(a01)*(b00)ââ(a01)*(b00)â| 2 min read How to calculate dot product of two vectors in Python? dot product or also known as the scalar product is an algebraic operation that takes two equal-length sequences of numbers and returns a single number. Let us given two vectors A and B, and we have to find the dot product of two vectors.Given that, A = a_1i + a_2j + a_3k B = b_1i + b_2j + b_3k Where 3 min read How to create a vector in Python using NumPy NumPy is a general-purpose array-processing package. It provides a high-performance multidimensional array object, and tools for working with these arrays. It is the fundamental package for scientific computing with Python. Numpy is basically used for creating array of n dimensions. Vector are built 4 min read Vector outer product with Einstein summation convention using NumPy in Python In this article, we will find vector outer product with Einstein summation convention in Python. numpy.einsum() method The numpy.einsum() method from the NumPy library is used to find the vector outer product with the Einstein summation convention in Python. Many common multi-dimensional, linear al 3 min read Like