Results for numba

December 2nd, 2023

Sorting non-negative integers in linear time using Numba breaks

I am trying to sort an array/list of non-negative integers in linear time. We also only keep the unique elements. Here is an example, Sort: [7, 7, 0, ...

November 10th, 2023

How to wrap an external function in numba such that the resulting function is cacheable?

I would like to wrap an external function with numba, but require that the resulting function is able to be cached with njit(cache=True) like I can do...

October 21st, 2023

Fastest way to add matrices of different shapes in Python/Numba

I want to "add" two matrices, a matrix a with shape (K,T) and a matrix b of shape (K,N), to result in a matrix of shape (K,T,N) The following works ok...

September 25th, 2023

List instead of a Tuple as a return: failed type inference in Numba jit-ted function

I am trying to use numba.jit to compile a function that takes several inputs and returns one Tuple. I specified the types of inputs and output within ...

September 13th, 2023

Why can't you use bitwise & with numba and uint64?

I have the following MWE: import numba as nb @nb.njit(nb.uint64(nb.uint64)) def popcount(x): b=0 while(x > 0): x &= x - 1 ...

September 5th, 2023

How to find extrema per cell in 3 dimensional array with Numba?

I have recently written a script to convert BGR arrays of [0, 1] floats to HSL and back. I posted it on Code Review. There is currently one answer but...

August 31st, 2023

Why is Jitted Numba function slower than original function?

I've written a function to create uniformly spaced points on a disk and since it's run quite often and on relatively large array I figured the applica...

November 29th, 2023

Matrix multiplication with a transposed NumPy array using Numba JIT does not work

Environment OS: Windows 10 Python version: 3.10 Numba version: 0.57.0 NumPy version: 1.24.3 Example import numpy as np from numba import njit @njit...

October 16th, 2023

Error when using `numpy.random.normal()` with Numba

I'm exploring a bit Numba to optimize some signal processing codes. According to Numba's documentation, the function from the numpy.random package is ...

October 17th, 2023

Can't install numba on Python 3.10

Python 3.10 on Mac running OS 11.6.1 I uninstalled Python 3.9 from my machine and upgraded to version 3.10. No problems installing standard packages s...

September 25th, 2023

numba :cannot determine Numba type of <class 'function'> python

Here is my code. from numba import jit import numpy as np import time from pandas.core.common import flatten from numba import njit b_wi=[[1,2,3,4],[...

September 12th, 2023

Calling fortran from numba with ctypes

Consider this fortran module, in the file test.f90 module mymod use iso_c_binding, only: c_double implicit none contains subroutine addstuff(a,b...

November 15th, 2023

How to parallelize this Python for loop when using Numba

I'm using the Anaconda distribution of Python, together with Numba, and I've written the following Python function that multiplies a sparse matrix A (...

- 25881
How do I undo the most recent local commits in Git?

- 11618
How can I remove a specific item from an array in JavaScript?

- 20343
How do I delete a Git branch locally and remotely?

- 7387
How can I find all files containing a specific text (string) on Linux?

- 7330
How to find all files containing specific text (string) on Linux?

- 7611
How do I revert a Git repository to a previous commit?

- 2671
How do I create an HTML button that acts like a link?

- 8481
How do I check out a remote Git branch?