[Numpy-discussion] MA.zeros problem

smpitts at ou.edu smpitts at ou.edu
Mon Aug 23 09:25:16 CDT 2004


Hi all,
I have some code that uses Numeric, and I'm trying to change it so that it supports MA as well. My code uses Numeric.zeros to create a matrix and then populates it, but I'm having trouble figuring out how to do something similar in MA.

Python 2.2.3 (#1, Oct 15 2003, 23:33:35) 
[GCC 3.3.1 20030930 (Red Hat Linux 3.3.1-6)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import MA
>>> MA.__version__
'11.1.0'
>>> a = MA.zeros((2,2))
>>> a
array(
 [[0,0,]
 [0,0,]])
>>> a[1][1] = 2
>>> a
array(
 [[0,0,]
 [0,0,]])

Is there some function to automatically create a masked array of arbitrary dimensions filled with zeroes? Thanks.
--
Stephen Pitts
smpitts at ou.edu 





More information about the Numpy-discussion mailing list