chrisspalm
unread,May 29, 2012, 2:56:20 AM5/29/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to bottle-neck
Here's the bench too on the same machine.
In [4]: bn.bench()
Bottleneck performance benchmark
Bottleneck 0.6.0rc1
Numpy (np) 1.6.1
Scipy (sp) 0.9.0
Speed is NumPy or SciPy time divided by Bottleneck time
NaN means one-third NaNs; float64 and axis=1 are used
High-level functions used (mode='fast')
no NaN no NaN no NaN NaN
NaN NaN
(10,10) (100,100) (1000,1000) (10,10) (100,100)
(1000,1000)
median 3.57 1.71 2.34 3.37
2.97 5.74
nanmedian 89.44 22.43 5.21 55.33
10.95 1.87
nansum 7.41 4.07 5.63 4.06
0.40 0.68
nanmax 1.64 1.16 1.01 1.43
1.09 1.07
nanmean 17.50 8.69 9.38 9.92
1.70 1.83
nanstd 24.90 6.43 9.11 10.66
1.02 1.31
nanargmax 5.94 3.86 6.58 3.51
0.44 0.69
ss 3.84 2.82 5.51 1.91
1.40 1.41
rankdata 23.56 17.00 13.55 12.55
8.63 5.36
partsort 1.16 1.81 2.40 2.60
3.49 6.68
argpartsort 0.62 1.78 2.01 2.10
3.41 6.30
replace 2.88 2.21 2.22 2.88
2.21 2.00
anynan 2.47 3.07 2.84 1.96
3.84 46.74
move_sum 8.58 100.22 623.85 5.32 48.87
495.47
move_nansum 20.11 112.98 683.94 9.58 12.79
118.75
move_mean 8.46 71.84 531.29 5.27 48.54
487.48
move_nanmean 21.71 81.16 563.07 10.88 12.03
108.60
move_std 10.49 24.87 222.32 13.43 88.00
818.85
move_nanstd 26.43 38.19 328.89 15.69 16.64
146.23
move_max 3.64 17.67 147.75 2.21 16.34
161.52
move_nanmax 14.47 20.61 163.93 7.34
6.91 62.78
Reference functions:
median np.median
nanmedian local copy of sp.stats.nanmedian
nansum np.nansum
nanmax np.nanmax
nanmean local copy of sp.stats.nanmean
nanstd local copy of sp.stats.nanstd
nanargmax np.nanargmax
ss scipy.stats.ss
rankdata scipy.stats.rankdata based (axis support added)
partsort np.sort, n=max(a.shape[1]/2,1)
argpartsort np.argsort, n=max(a.shape[1]/2,1)
replace np.putmask based (see bn.slow.replace)
anynan np.isnan(arr).any(axis)
move_sum sp.ndimage.convolve1d based, window=a.shape[1] // 5
move_nansum sp.ndimage.convolve1d based, window=a.shape[1] // 5
move_mean sp.ndimage.convolve1d based, window=a.shape[1] // 5
move_nanmean sp.ndimage.convolve1d based, window=a.shape[1] // 5
move_std sp.ndimage.convolve1d based, window=a.shape[1] // 5
move_nanstd sp.ndimage.convolve1d based, window=a.shape[1] // 5
move_max sp.ndimage.maximum_filter1d based, window=a.shape[1] //
5
move_nanmax sp.ndimage.maximum_filter1d based, window=a.shape[1] //
5