the multiplication operation for examplewe can demean each column of an array by subtracting the column means in this caseit is very simplein [ ]arr randn( in [ ]arr mean( out[ ]array( ]in [ ]demeaned arr arr mean( in [ ]demeaned out[ ]array([ - - ][- - ][- - ] - ]]in [ ]demeaned mean( out[ ]array( - - ]see figure - for an illustration of this operation demeaning the rows as broadcast operation requires bit more care fortunatelybroadcasting potentially lower dimensional values across any dimension of an array (like subtracting the row means from each column of two-dimensional arrayis possible as long as you follow the rules this brings us tofigure - broadcasting over axis with array the broadcasting ru two arrays are compatible for broadcasting if for each trailing dimension (that isstarting from the end)the axis lengths match or if either of the lengths is broadcasting is then performed over the missing and or length dimensions even as an experienced numpy useri often must stop to draw pictures and think about the broadcasting rule consider the last example and suppose we wished instead to subtract the mean value from each row since arr mean( has length it is compatible broadcasting www it-ebooks info