[Numpy-discussion] Medians that ignore values

Peter Saffrey pzs@dcs.gla.ac...
Fri Sep 19 04:51:55 CDT 2008


David Cournapeau <david <at> ar.media.kyoto-u.ac.jp> writes:

> You can use nanmean (from scipy.stats):
> 

I rejoiced when I saw this answer, because it looks like a function I can just
drop in and it works. Unfortunately, nanmedian seems to be quite a bit slower
than just using lists (ignoring nan values from my experiments) and a home-brew
implementation of median. I was mostly using numpy for speed...

I would like to try the masked array approach, but the Ubuntu packages for scipy
and matplotlib depend on numpy. Does anybody know whether I can naively do "sudo
python setup.py install" on a more modern numpy without disturbing scipy and
matplotlib, or do I need to uninstall all three packages and install them
manually from source?

On my 64 bit machine, the Ubuntu numpy package is even more out of date:

$ dpkg -l | grep numpy
ii  python-numpy                               1:1.0.4-6ubuntu3 

Does anybody know why this is? I might be willing to help bring the repository
up to date, if anybody can give me pointers on how to do this.

Peter



More information about the Numpy-discussion mailing list