Whatever the current state of the implementation, the original intention was that ma be, where it makes sense, a "drop-in" replacement for numpy arrays. Being retired I don't read this list all that carefully but I did see some subjects concerning axis defaults (about the 98th time we have had that discussion I suppose) and perhaps ma and numpy got out of sync, even if they were in sync to begin with. 
<br><br>For sum, x.sum() should be the sum of the entire array, no? And that implies a default of None, doesn't it? So a default of zero or one would be wrong. <br><br>Oh well, back to my nap.<br><br><div><span class="gmail_quote">
On 28 Aug 2006 22:26:54 -0700, <b class="gmail_sendername">PGM</b> <<a href="mailto:pgmdevlist@gmail.com">pgmdevlist@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Folks,<br>I keep running into the following problem since some recent update (I'm<br>currently running 1.0b3, but the problem occurred roughly around 0.9.8):<br><br>>>> import <a href="http://numpy.core.ma">numpy.core.ma
</a> as MA<br>>>> x=MA.array([[1],[2]],mask=False)<br>>>> x.sum(None)<br>/usr/lib64/python2.4/site-packages/numpy/core/ma.py in reduce(self, target,<br>axis, dtype)<br>    393                 m.shape = (1,)
<br>    394         if m is nomask:<br>--> 395             return masked_array (self.f.reduce (t, axis))<br>    396         else:<br>    397             t = masked_array (t, m)<br><br>TypeError: an integer is required<br>
#................................<br><br>Note that x.sum(0) and x.sum(1)  work fine. I know some consensus seems to be<br>lacking with MA, but still, I can't see why axis=None is not recognized.<br><br>Corollary: with masked array, the default axis for sum is 0, when it's None
<br>for regular arrays. Is there a reason for this inconsistency ?<br><br>Thanks a lot<br><br>-------------------------------------------------------------------------<br>Using Tomcat but need to do more? Need to support web services, security?
<br>Get stuff done quickly with pre-integrated technology to make your job easier<br>Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo<br><a href="http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642">
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642</a><br>_______________________________________________<br>Numpy-discussion mailing list<br><a href="mailto:Numpy-discussion@lists.sourceforge.net">
Numpy-discussion@lists.sourceforge.net</a><br><a href="https://lists.sourceforge.net/lists/listinfo/numpy-discussion">https://lists.sourceforge.net/lists/listinfo/numpy-discussion</a><br><br></blockquote></div><br>