[Numpy-discussion] bug with with fill_values in masked arrays?
Wed Mar 26 13:47:22 CDT 2008
Matt Knox wrote:
> data = [1., 2., 3., np.nan, 5., 6.]
> mask = [0, 0, 0, 1, 0, 0]
I'm creating the ma with ma.masked_where...
> marr = ma.array(data, mask=mask)
> print marr is ma.masked # False
> print marr # ma.masked constant
Yeah, and this is where I have the problem. The masked constant has a
fill value of 99999, rather than 55. That is annoying.
> filled_arr = marr.filled()
> print filled_arr # nan value is replaced with fill value of 55
Right, and this is how I currently work around the problem.
Simplistix - Content Management, Zope & Python Consulting
More information about the Numpy-discussion