Another way to do this would be to use numba package to generate LLVM IR from Python bytecode (it supports a rich set of instructions including numpy stuff, has type inference, etc), and then run it in the browser via emscripten, with some adjustments to the IR if required.
Quick googling yields a related blog post: http://cyrille.rossant.net/numpy-browser-llvm/