This is the code:
import time, numpy, MA
start = time.clock()
a = numpy.ones(1000000)
cur = time.clock()
print "numpy create", cur - start
start = cur
for i in xrange(1000000):
a[i] = i
cur = time.clock()
print "numpy fill", cur - start
start = cur
a = MA.array(numpy.empty(1000000), mask=1)
cur = time.clock()
print "MA create", cur - start
start = cur
for i in xrange(1000000):
a[i] = i
cur = time.clock()
print "MA fill", cur - start
start = cur
This is the output:
numpy create 0.01
numpy fill 0.39
MA create 0.15
MA fill 17.06
/me cries