[Numpy-discussion] Questions about masked arrays
Tue Oct 6 20:54:16 CDT 2009
On Tue, Oct 6, 2009 at 7:38 PM, Pierre GM <firstname.lastname@example.org> wrote:
> On Oct 6, 2009, at 6:57 PM, Gökhan Sever wrote:
> > Seeing a different filling value is causing confusion. Both for
> > myself, and when I try to demonstrate the usage of masked array to
> > other people.
> Fair enough. I must admit that `fill_value` is a vestige from the
> previous implementation (talking pre 1.2 here), that is no longer
> really needed (cf below for more details).
> > Also say, if I want to replace that one element back to its original
> > state will it use fill_value as 1e+20 or 999999.9999?
> What do you mean by 'replace back to its original state' ? Using
> `filled`, you mean ?
Yes, in more properly stated fashion "filled" :)
masked_array(data = --,
mask = True,
fill_value = 1e+20)
Little buggy, isn't it? It properly fill the whole array:
array([ 1.31509000e+01, 1.31309000e+01, 1.31278000e+01,
1.31542000e+01, 1.00000000e+06, 1.31539000e+01,
1.31387000e+01, 1.00000000e+06, 1.00000000e+06,
1.00000000e+06, 1.31107000e+01, 1.31351000e+01,
1.32073000e+01, 1.32562000e+01, 1.33533000e+01,
1.33889000e+01, 1.34067000e+01, 1.32938000e+01,
1.31962000e+01, 1.31248000e+01, 1.30411000e+01,
1.29534000e+01, 1.28354000e+01, 1.27392000e+01,
> > > 2-) What is wrong with the arccos calculation? Should not that
> > > result the same as with cos(d) result?
> > I first tested on 1.3.0, and later on my laptop using 1.4dev version
> > which is about an old month built.
> > Once again the results for each arc... function
> Er, I assume it's np.arccos ?
Sorry too much time spent in ipython -pylab :)
Base Class: <type 'numpy.ufunc'>
String Form: <ufunc 'arccos'>
> Anyway, I'm puzzled. Works like a charm here (r7438 for numpy.ma).
> Could it be that something went wrng with some ufuncs ?
This I don't know :(
> I didn't touch
> ma since 09/08 (thanks, svn history), so I don't think it comes from
Yes, SVN is a very useful invention indeed.
For some reason it doesn't list check-out revision.
Doing an ls -l reveals that those are checked-out and installed after August
13 which was a preparation for the SciPy 09 :)
Would you mind trying a more recent svn version ?
This is the last resort. I will eventually try this if I don't any other
I confirmed the same arccos weirdness in Sage Notebook (www.sagenb.org)
where Numpy 1.3.0 is installed there.
> NumPy-Discussion mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion