If you work with Python for data science, statistics, machine learning, or scientific computing, you will likely encounter NumPy. But you may not have heard of Numba.
I once developed an algorithm for a descriptor and expected it to run faster than some existing descriptors. Surprisingly, it was actually slower, even though the implementation already made extensive use of NumPy's vectorized operations. I decided to investigate why, and the problem soon became clear: the algorithm performed a large number of repeated numerical operations within loops. Although the individual NumPy operations were optimized, repeatedly calling them from Python introduced considerable overhead, especially as the number of iterations increased. Then I discovered Numba. By using Numba to compile the computationally intensive portions of the algorithm, I was able to reduce much of this overhead, and the same algorithm subsequently became considerably faster. That experience made me curious about the relationship between NumPy and Numba and why they can produce such different performance outcomes.
The names sound remarkably similar, and both are used in numerical computing. So, are NumPy and Numba competing tools? Not at all. Like siblings, they have different roles and live different lives, but their differences are precisely what makes them complementary. NumPy excels at numerical and array operations, while Numba focuses on accelerating computationally intensive Python code.






