Re: [Numpy-discussion] bug with with fill_values in masked arrays?

2008-04-08 Thread Hans Meine
Am Dienstag, 25. März 2008 15:33:58 schrieb Chris Withers: Because in your particular case, you're inspecting elements one by one, and then, your masked data becomes the masked singleton which is a special value. I'd argue that the masked singleton having a different fill value to the ma

Re: [Numpy-discussion] bug with with fill_values in masked arrays?

2008-03-26 Thread Chris Withers
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) marr.set_fill_value(55) print marr[0] is ma.masked # False print marr[3] # ma.masked constant Yeah, and this is where I have the

Re: [Numpy-discussion] bug with with fill_values in masked arrays?

2008-03-26 Thread Chris Withers
Pierre GM wrote: My bad, I neglected an overall doc for the functions and their docstring. But you know what ? As you're now at an intermediary level, That's pretty unkind to your userbase. I know a lot about python, but I'm a total novice with numpy and even the maths it's based on. help:

Re: [Numpy-discussion] bug with with fill_values in masked arrays?

2008-03-26 Thread Pierre GM
On Wednesday 26 March 2008 15:42:41 Chris Withers wrote: Pierre GM wrote: My bad, I neglected an overall doc for the functions and their docstring. But you know what ? As you're now at an intermediary level, That's pretty unkind to your userbase. I know a lot about python, but I'm a total

Re: [Numpy-discussion] bug with with fill_values in masked arrays?

2008-03-25 Thread Chris Withers
Pierre GM wrote: Well, yeah, my bad, that depends on whether you use masked_invalid or fix_invalid or just build a basic masked array. Yeah, well, if there were any docs I'd have a *clue* what you were talking about ;-) y=ma.fix_invalid(x) I've never done this ;-) Having NaNs

Re: [Numpy-discussion] bug with with fill_values in masked arrays?

2008-03-21 Thread Chris Withers
Pierre GM wrote: This sucks to the point of feeling like a bug :-( It is not. Ignoring the fill value of masked array feels like a bug to me... Why is it desirable for it to behave like this? Because that way, you can compare anything to masked and see whether a value is masked or not.

Re: [Numpy-discussion] bug with with fill_values in masked arrays?

2008-03-21 Thread Chris Withers
Pierre GM wrote: On Wednesday 19 March 2008 19:47:37 Matt Knox wrote: 1. why am I not getting my NaN's back? Because they're gone when you create your masked array. Really? At least one other post has disagreed with that. And it does seem odd that a value, even if it's a nan, would be

Re: [Numpy-discussion] bug with with fill_values in masked arrays?

2008-03-21 Thread Pierre GM
On Friday 21 March 2008 12:52:45 Chris Withers wrote: Pierre GM wrote: This sucks to the point of feeling like a bug :-( It is not. Ignoring the fill value of masked array feels like a bug to me... You're right with masked arrays, but here we're talking the masked singleton, a special

Re: [Numpy-discussion] bug with with fill_values in masked arrays?

2008-03-20 Thread Chris Withers
Matt Knox wrote: 1. why am I not getting my NaN's back? when iterating over a masked array, you get the ma.masked constant for elements that were masked (same as what you would get if you indexed the masked array at that element). If you are referring specifically to the .data portion of

[Numpy-discussion] bug with with fill_values in masked arrays?

2008-03-19 Thread Chris Withers
OK, my specific problem with masked arrays is as follows: a = numpy.array([1,numpy.nan,2]) aa = numpy.ma.masked_where(numpy.isnan(a),a) aa array(data = [ 1.e+00 1.e+20 2.e+00], mask = [False True False], fill_value=1e+020)