[Numpy-discussion] bug in oldnumeric.ma

Charles Doutriaux doutriaux1 at llnl.gov
Wed May 7 13:35:17 EDT 2008


The following code works with numpy.ma but not numpy.oldnumeric.ma, 
obviously it shouldn't have missing values...
Note that replacing 2. with 2 (int) works, dtype does not seem to matter

import numpy.oldnumeric.ma as MA,numpy
s = MA.array([ 12.16271591, 11.19478798, 10.27440453,  9.60334778,  
9.2451086,  9.13312435,  9.11890984,  9.03033924,  8.7346344,  
8.18558788,  7.43921041,  6.62947559,  5.90856123,  5.37711906,  
5.03489971,  4.77586126,  4.4189887 , 3.76522899,  2.65106893,  
0.99725384, -1.1513288,  -3.58740163, -5.93836021, -7.72085428, 
-8.4840517, -7.98519516, -6.31602335, -3.89117384, -1.29867446,  
0.90583926,  2.3683548,  3.00160909,  2.94496846,  2.44637036,  
1.7288276,  0.89646715, -0.07413431, -1.25960362, -2.67903948, 
-4.22316313, -5.66368866, -6.74747849, -7.31541586, -7.37950087, 
-7.12536144, -6.82764053, -6.74864483, -7.04398584, -7.73052883, 
-8.70125961, -9.77933311, -10.78447914, -11.59126091, -12.1706562, 
-12.60001087, -13.03606987, -13.64736843 , -14.51338005, -15.52330303, 
-16.33303833, -16.46606064, -15.52666664, -13.45486546, -10.63810158, 
-7.79133797, -5.66280842, -4.72991323, -5.03621674, -6.21381569, 
-7.6610961, -8.78764057, -9.22090816, -8.91826916, -8.14496899, 
-7.33739614, -6.91325617, -7.09938431, -7.84141493, -8.829319,  
-9.63222504, -9.88238335, -9.44395733, -8.4723177,  -7.35424185, 
-6.54324722, -6.36360407, -6.85566664, -7.74132967, -8.51024342, 
-8.62310696, -7.73065567, -5.82352972, -3.24726033, -0.5881027 , 
1.51040995,  2.52599192,  2.19137073,  0.56473863, -1.97977543, 
-4.84694195, -7.40427446, -9.2083149, -10.16563416, -10.53237438, 
-10.75102997, -11.21533489, -12.09201908, -13.28770447, -14.54858589, 
-15.62684536, -16.40594101, -16.91949844, -17.27025032, -17.51157188, 
-17.57112694, -17.25679016, -16.32791138, -14.58930111, -11.96431351, 
-8.52671432, -4.49569035, -0.20288418,  3.96036053,  7.60605049, 
10.41992378, 12.21882153, 12.98544502, 12.87247849],dtype='f')
s2c=MA.power(s,2.)

print MA.count(s)
print MA.count(s2c)




More information about the NumPy-Discussion mailing list