[SciPy-user] Ideas about matrices

Marco gaedol at gmail.com
Tue Nov 7 08:40:28 CST 2006


Hi!
What about:

from scipy import array
from scipy import random

size=(8,3)
a=random.randint(0,2,size)
print a

?

Returns this:

array([[1, 0, 1],
       [1, 0, 1],
       [0, 0, 0],
       [1, 0, 0],
       [1, 0, 1],
       [1, 0, 1],
       [1, 1, 1],
       [0, 0, 0]])

which is good to me.
Any contraindication?

Thanks,

marco


More information about the SciPy-user mailing list