From: Travis E. O. <oli...@ie...> - 2005-12-05 20:42:09
|
Eric Firing wrote: I replied privately to Eric by mistake. > John, Travis, > > Now I find a genuine difference between scipy and num* that is causing a > problem: for a masked array, say "A", A.mask is a property in scipy but > a function in num*. I can work around it, but it seems like an anomaly > in scipy. What it means is that in matplotlib we can't use A.mask or > A.mask(), but must instead use the ma.getmask() function. Paul is the author of masked arrays. He implemented the new behavior. I think mask as a property/attribute is right. > > > Here is another anomaly that I needed to work around: > > >>> bb = scipy.array([1.1,2,2,3.3]) > >>> 1.1 in bb > Traceback (most recent call last): > File "<stdin>", line 1, in ? > ValueError: The truth value of an array with more than one element is > ambiguous. Use a.any() or a.all() > >>> import numarray > >>> nn = numarray.array([1.1,2.2,3.3]) > >>> 1.1 in nn > True This is a bug in scipy core that has been fixed for several weeks. It came about as an unintentional side-effect of raising an error for truth-testing of arrays. Notice: >>> 1.1 in scipy.array([1.1,2.2,3.3]) True -Travis |