bottleneck icon indicating copy to clipboard operation
bottleneck copied to clipboard

np.nansum is not slow than bn.nansum when use float32

Open isaac-you opened this issue 4 years ago • 1 comments

import bottleneck as bn
import numpy as np

m1 = np.random.randn(300,3000)
m1_32 = m1.astype(np.float32)

%timeit np.nansum(m1,axis=1)
%timeit bn.nansum(m1,axis=1)

%timeit np.nansum(m1_32,axis=1)
%timeit bn.nansum(m1_32,axis=1)

when use float64 then bottleneck is faster but float32 bottleneck is slower

isaac-you avatar Apr 04 '20 05:04 isaac-you

I believe this is simple to fix, thanks for reporting!

qwhelan avatar Apr 10 '20 05:04 qwhelan