You can also use Numba to speed up loops. It’s still slower than C, but it’s much better than plain Python code, and it’s really easy to implement (just import numba and put a @numba.njit() before your function).
import numba
@numba.njit()
You can also use Numba to speed up loops. It’s still slower than C, but it’s much better than plain Python code, and it’s really easy to implement (just
import numba
and put a@numba.njit()
before your function).