[SciPy-User] Bottleneck

Keith Goodman kwgoodman@gmail....
Tue Nov 30 13:50:11 CST 2010


The naming saga [1] continues:

Nanny --> STAT --> DSNA --> Bottleneck

Bottleneck is a collection of fast, NumPy array functions written in Cython.

https://github.com/kwgoodman/bottleneck

I'm almost ready for a first preview release. If anyone could install
the package (directions in readme) and run the unit tests on windows
or mac or 32-bit linux, I'd be very interested in the results.

Future plans:

0.1 preview release
0.2 Add a Cython apply_along_axis function so only the 1d case needs
to be coded by hand
0.2 Template the code to expand dtype coverage, make maintainable
0.3 Add more functions

Some benchmarks:

>>> bn.benchit(verbose=False)
Bottleneck performance benchmark
    Bottleneck  0.1.0dev
    Numpy       1.5.1
    Scipy       0.8.0
    Speed is numpy (or scipy) time divided by Bottleneck time
    NaN means all NaNs
   Speed   Test                  Shape        dtype    NaN?
   2.4019  median(a, axis=-1)    (500,500)    float64
   2.2668  median(a, axis=-1)    (500,500)    float64  NaN
   4.1235  median(a, axis=-1)    (10000,)     float64
   4.3498  median(a, axis=-1)    (10000,)     float64  NaN
   9.8184  nanmax(a, axis=-1)    (500,500)    float64
   7.9157  nanmax(a, axis=-1)    (500,500)    float64  NaN
   9.2306  nanmax(a, axis=-1)    (10000,)     float64
   8.1635  nanmax(a, axis=-1)    (10000,)     float64  NaN
   6.7218  nanmin(a, axis=-1)    (500,500)    float64
   7.9112  nanmin(a, axis=-1)    (500,500)    float64  NaN
   6.4950  nanmin(a, axis=-1)    (10000,)     float64
   8.0791  nanmin(a, axis=-1)    (10000,)     float64  NaN
  12.3650  nanmean(a, axis=-1)   (500,500)    float64
  42.0738  nanmean(a, axis=-1)   (500,500)    float64  NaN
  12.2769  nanmean(a, axis=-1)   (10000,)     float64
  22.1285  nanmean(a, axis=-1)   (10000,)     float64  NaN
   9.5515  nanstd(a, axis=-1)    (500,500)    float64
  68.9192  nanstd(a, axis=-1)    (500,500)    float64  NaN
   9.2174  nanstd(a, axis=-1)    (10000,)     float64
  26.1753  nanstd(a, axis=-1)    (10000,)     float64  NaN

[1] http://mail.scipy.org/pipermail/scipy-user/2010-November/027553.html


More information about the SciPy-User mailing list