numba

Performance of various numpy fancy indexing methods, also with numba

落花浮王杯 提交于 2019-11-27 01:03:14
问题 Since for my program fast indexing of Numpy arrays is quite necessary and fancy indexing doesn't have a good reputation considering performance, I decided to make a few tests. Especially since Numba is developing quite fast, I tried which methods work well with numba. As inputs I've been using the following arrays for my small-arrays-test: import numpy as np import numba as nb x = np.arange(0, 100, dtype=np.float64) # array to be indexed idx = np.array((0, 4, 55, -1), dtype=np.int32) # fancy

How to pass additional parameters to numba cfunc passed as LowLevelCallable to scipy.integrate.quad

旧城冷巷雨未停 提交于 2019-11-26 23:34:42
问题 The documentation discusses using numba's cfunc s as LowLevelCallable argument of scipy.integrate.quad . I need the same thing with additional parameter. I'm basically trying to do something like this: import numpy as np from numba import cfunc import numba.types voidp = numba.types.voidptr def integrand(t, params): a = params[0] # this is additional parameter return np.exp(-t/a) / t**2 nb_integrand = cfunc(numba.float32(numba.float32, voidp))(integrand) However, it does not work, because

Improve Pandas Merge performance

孤人 提交于 2019-11-26 23:29:11
问题 I specifically dont have performace issue with Pands Merge, as other posts suggest, but I've a class in which there are lot of methods, which does a lot of merge on datasets. The class has around 10 group by and around 15 merge. While groupby is pretty fast, out of total execution time of 1.5 seconds for class, around 0.7 seconds goes in those 15 merge calls. I want to speed up performace in those merge calls. As I will have around 4000 iterations, hence saving .5 seconds overall in single

running librosa & numba on raspberry pi 3

徘徊边缘 提交于 2019-11-26 21:58:42
问题 I am trying to run librosa on my raspberry pi 3. After hours of searching through the internet I was finally able to install it but it still throws an error when I try to import it. First, I had problems to install the dependency llvmlite. I finally installed it with the following code: conda install -c numba llvmlite I use python 3.4 build with miniconda. After llvmlite was installed I was able to install librosa with pip (not possible with conda) pi@raspberrypi:~ $ pip install librosa