print (np sqrt( )[[ [ ]in order to compute matrix multiplications and compute inner products of vectorsnumpy' dot function can be usedeither as method of an ndarray instance or as method of np print (np dot( , )[[ [ ]print ( dot( )same as np dot( , [[ [ ]since version of pythonit is possible to multiply two ndarrays using the operator (which implements the np matmul methodfor matricesthis is similar to using the dot method for higher-dimensional arrays the two methods behave differently operator print ( [[ [ ]numpy allows arithmetic operations on arrays of different shapes (dimensionsspecificallysuppose two arrays have dimensions ( and ( )respectively the arrays or shapes are said to be aligned if for all it holds that aligned mi ni or min{mi ni or either mi or ni or both are missing for exampleshapes ( and ( are alignedas are ( and ( however( and ( are not aligned numpy "duplicatesthe array elements across the smaller dimension to match the larger dimension this process is called broadcasting and is carried out without actually making copiesthus providing efficient memory use below are some examples import numpy as np anp arange ( reshape ( , ( , array np array ([ , ] reshape ( , ( ,array ( , array print ( shapes ( , and ( ,print ( shapes ( , and ( , broadcasting