Bottleneck 0.6.0

Fast NumPy array functions written in Cython
The Bottleneck package is a collection of fast NumPy array functions written in Cython:

NumPy/SciPy median, nanmedian, nanmin, nanmax, nanmean, nanstd, nanargmin, nanargmax
Functions nanvar
Moving window move_nanmean
Group by group_nanmean

Let's give it a try. Create a NumPy array:

>>> import numpy as np
>>> arr = np.array([1, 2, np.nan, 4, 5])


Find the nanmean:

>>> import bottleneck as bn
>>> bn.nanmean(arr)
3.0


Moving window nanmean:

>>> bn.move_nanmean(arr, window=2)
array([ nan, 1.5, 2. , 4. , 4.5])


Group nanmean:

>>> label = ['a', 'a', 'b', 'b', 'a']
>>> bn.group_nanmean(arr, label)
(array([ 2.66666667, 4. ]), ['a', 'b'])


Complete documentation:
http://pypi.python.org/pypi/Bottleneck/0.2.0

last updated on:
June 5th, 2012, 23:40 GMT
price:
FREE!
developed by:
Keith Goodman
license type:
BSD License 
category:
ROOT \ Science

FREE!

In a hurry? Add it to your Download Basket!

user rating

UNRATED
0.0/5
 

0/5

Add your review!

SUBMIT