Numpy inner() method is used to compute the inner product of two given input arrays. In the case of 1D arrays, the ordinary inner product of vectors is returned (without complex conjugation), whereas, in case of higher dimensions, a sum-product over the last axes is returned as a result.

Syntax

numpy.inner(arr1, arr2)

Parameters

The inner() function takes at most two parameters:

arr1: array_like, the first input array

arr2: array_like, the second input array

if arr1 and arr2 are non–scalars, their last dimensions must match.

#python #numpy

Numpy inner() Method in Python
1.25 GEEK