5 ms·
As someone that has numerical code at the bottom of my research applications, Numba looks really exciting to me. Shaving off a constant factor means more experi
by ninjin 13y ago
As someone that has numerical code at the bottom of my research applications, Numba looks really exciting to me. Shaving off a constant factor means more experiments etc.
But one of the nice things about NumPy is that it allows you to make very complicated operations largely transparent thanks to broadcasting. Just compare pairwise_numpy vs. pairwise_python on the blog post you linked. I don't think anyone really favours the version that you can apply the Numba JIT to.
I know that I will cave eventually when I am desperate for speed, I already do write C99 extensions at times (not for numerical code though). I just wish there was a way to use expressions rather than going full imperative to gain some of that speed.
- takluyver 13y agoNo-one favours the pure Python version at the moment, because we're used to it being unworkably slow. In terms of the actual code, I do prefer pairwise_python in that example, because I can see roughly what's going on. pairwise_numpy is kind of like writing in Perl - it's short, but hard to understand. I use the SciPy stack, and I don't fully understand it. How does slicing a 2D array into three dimensions work?