[Numpy-discussion] Weighted scoreatpercentile or median?

2010-07-26 Thread Ole Streicher
Hi list, is there a way to compute the weighted median or the weighted percentile http://en.wikipedia.org/wiki/Percentile#Weighted_Percentile with numpy or scipy? I only found the "scoreatpercentile" function in scipy.stat, and the "median" functions of scipy.stat and numpy, but they both dont al

Re: [Numpy-discussion] Apply a function to all indices

2010-02-26 Thread Ole Streicher
Hello Ernest, Ernest Adrogué writes: > It depends on what exactly you want to do. If you just want > to iterate over the array, try something liks this > for element in a[a > 0.8]: > myfunc(element) No; I need to iterate over the *indices*, not over the elements. a = numpy.random.random((

[Numpy-discussion] Apply a function to all indices

2010-02-26 Thread Ole Streicher
Hi, I want to apply a function to all indices of an array that fullfill a certain condition. What I tried: -8< import numpy def myfunc(x): print 'myfunc of', x a = numpy.random.random((2,3,4)) numpy.apply_along_axis(myfunc, 0, numpy.where

[Numpy-discussion] Segfault when using scipy.special.hermite?

2009-10-28 Thread Ole Streicher
Hi, Is there something wrong with scipy.special.hermite? The following code produces glibc errors: 8<--- import scipy.special h = [] for i in xrange(15): print i h.append(scipy.special.hermite(i+1)) 8<--- results in ... 12 *