Python | Numpy np.kron() method

With the help of np.kron() method, we can get the Kronecker product of two lists by using np.kron() method.

Syntax : np.kron(list1, list2)

Return : Return the kronecker product of two list.

Example #1 :
In this example we can see that by using np.kron() method, we are able to get the kronecker product of two arrays passed as argument.

filter_none

edit
close

play_arrow

link
brightness_4
code

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

chevron_right


Output :



[ 5 10 15 10 20 30 15 30 45]

Example #2 :

filter_none

edit
close

play_arrow

link
brightness_4
code

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

chevron_right


Output :

[[ 5 10 15 10 20 30 15 30 45]
[ 45 90 135 40 80 120 35 70 105]]

My Personal Notes arrow_drop_up

Image
Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.