Python | Numpy np.ma.innerproduct () method

Using the np.ma.innerproduct() method we can calculate the cross product of two lists using np.ma.innerproduct () .

Syntax: np.ma.innerproduct ()
Return: Return a vector product of two lists.

Example # 1:
In this example, we can see that with np.ma.innerproduct () we can get the value of the inner product of two vectors.

# NumPy import

import numpy.ma as ma

  
# using the np.ma.innerproduct () method

gfg = ma.innerproduct ([ 1 , 2 , 3 ], [ 5 , 5 , 5 ])

 

print (gfg)

Exit :

30

Example # 2:

# NumPy import

import numpy.ma as ma

 
# using the np.ma.innerproduct () method

gfg   = ma.innerproduct ([[ 1 , 2 , 3 ], [ 7 , 8 , 9 ]], [ 5 , 5 , 5 ])

  

print (gfg)

Output:

[30 120]