From Wikipedia, the free encyclopedia
Jump to navigation Jump to search
Original author(s)Continuum Analytics
Developer(s)Community project
Initial release15 August 2012; 9 years ago (2012-08-15)
Stable release
0.55.2[1] / 26 May 2022; 37 days ago (2022-05-26)
Preview release
0.54.0rc2 / 16 July 2021; 11 months ago (2021-07-16)
Written inPython, C
Operating systemCross-platform
TypeTechnical computing

Numba is an open-source JIT compiler that translates a subset of Python and NumPy into fast machine code using LLVM, via the llvmlite Python package. It offers a range of options for parallelising Python code for CPUs and GPUs, often with only minor code changes.

Numba was started by Travis Oliphant in 2012 and has since been under active development at with frequent releases. The project is driven by developers at Anaconda, Inc., with support by DARPA, the Gordon and Betty Moore Foundation, Intel, Nvidia and AMD, and a community of contributors on GitHub.


Numba can be used by simply applying the numba.jit decorator to a Python function that does numerical computations:

import numba
import random

def monte_carlo_pi(n_samples: int):
    acc = 0
    for i in range(n_samples):
        x = random.random()
        y = random.random()
        if (x**2 + y**2) < 1.0:
            acc += 1
    return 4.0 * acc / n_samples

The Just-in-time compilation happens transparently when the function is called:

>>> monte_carlo_pi(1000000)

The Numba website at contains many more examples, as well as information on how to get good performance from Numba.

GPU support[edit]

Numba can compile Python functions to GPU code. Currently two backends are available:

Alternative approaches[edit]

Numba is one approach to make Python fast, by compiling specific functions that contain Python and Numpy code. Many alternative approaches for fast numeric computing with Python exist, such as Cython, TensorFlow, PyTorch, Chainer, Pythran, and PyPy.


  1. ^ "Releases · numba/numba". GitHub. Retrieved 2021-06-01.