From: Chris W. <ch...@si...> - 2008-03-19 11:14:24
|
Eric Firing wrote: > This is not doing what you think it is, Indeed, I guess I was seeing nans being treated as missing values rather than being masked... > You should use numpy.masked_where(numpy.isnan(aa), aa). I am now ;-) However, I'm still running into problems when I try and plot the gappy data on a filled line as follows: dates = *an array of datetimes* values = *an array containing data values and a few nans* values = numpy.ma.masked_where(numpy.isnan(values),values) xs,ys = mlab.poly_between(dates,0,values) pylab.fill(xs,ys,'r') For starters, I get this warning: numpy\core\ma.py:609: UserWarning: Cannot automatically convert masked array to numeric because data is masked in one or more locations. ...and wherever a NaN occurs in the data, the line is plotted off the top of the axes. I want it to appear at 0 if there's no data. Well, ideally just not appear at all, but I'd settle for appearing at 0... Any ideas? cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk |