From: Eric F. <ef...@ha...> - 2006-07-14 00:44:29
|
Webb Sprague wrote: > Could someone recommend a way to average an array along the columns > without propagating the nans and without turning them into some weird > number which bias the result? I guess I can just keep using an > indexing array for fooArray, but if there is somehting more graceful, > I would love to know. Something like this: import numpy as N ym = N.ma.masked_where(N.isnan(y), y) yaverage = N.ma.average(ym) > > Boy missing data is a pain in the neck... It certainly is, but Masked Arrays ease the pain. Eric |