[Numpy-discussion] Using matplotlib's prctile on masked arrays

Pierre GM pgmdevlist at gmail.com
Tue Oct 27 13:23:49 EDT 2009


On Oct 27, 2009, at 7:56 AM, Gökhan Sever wrote:
>
>
> Unfortunately, matplotlib.mlab's prctile cannot handle this division:

Actually, the division's OK, it's mlab.prctile which is borked. It  
uses the length of the input array instead of its count to compute the  
nb of valid data. The easiest workaround in your case is probably to  
use:
 >>> prctile((am/bm).compressed(), p=[5,25,50,75,95])
HIH
P.


More information about the NumPy-Discussion mailing list