I\'m trying to port some of my code from matlab to python, and some of it uses the bsxfun() function for virtual replication followed by multiplication or division (I also u
There isn't really an equivalent of bsxfun, that I'm aware of, although numpy does take care of a lot of broadcasting for you, as others mentioned.
This is commonly touted as an advantage of numpy over matlab, and it is true that a lot of broadcasting is simpler in numpy, but bsxfun is actually more general, because it can take user-defined functions.
Numpy has this: http://docs.scipy.org/doc/numpy/reference/generated/numpy.apply_along_axis.html but only for 1d.