Friday, January 30, 2026
HomeLanguagesPython | Numpy np.ma.innerproduct() method

Python | Numpy np.ma.innerproduct() method

With the help of np.ma.innerproduct() method, we can calculate the vector product of two list by using np.ma.innerproduct() method.

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

Example #1 :
In this example we can see that by using np.ma.innerproduct() method, we are able to get the value of inner product of two vectors.




# import numpy
import numpy.ma as ma
  
# using np.ma.innerproduct() method
gfg = ma.innerproduct([1, 2, 3], [5, 5, 5])
  
print(gfg)


Output :

30

Example #2 :




# import numpy
import numpy.ma as ma
  
# using np.ma.innerproduct() method
gfg = ma.innerproduct([[1, 2, 3], [7, 8, 9]], [5, 5, 5])
  
print(gfg)


Output :

[ 30 120]

Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32478 POSTS0 COMMENTS
Milvus
122 POSTS0 COMMENTS
Nango Kala
6849 POSTS0 COMMENTS
Nicole Veronica
11978 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12065 POSTS0 COMMENTS
Shaida Kate Naidoo
6987 POSTS0 COMMENTS
Ted Musemwa
7222 POSTS0 COMMENTS
Thapelo Manthata
6934 POSTS0 COMMENTS
Umr Jansen
6917 POSTS0 COMMENTS