John Fouhy wrote:

>> I found it somewhat annoying that in order to define a two-dimensional array
>> in python I need some may [[[]]] and ,,:
>> A = array([[0,   1,  2,  3],   # initialize 2-d array
>>            [4,   5,  6,  7],
>>            [8,   9, 10, 11],
>>            [12, 13, 14, 15]])

In [7]: import numpy
In [9]: a=numpy.arange(16).reshape(4,4)
In [10]: a
Out[10]:
array([[ 0,  1,  2,  3],
        [ 4,  5,  6,  7],
        [ 8,  9, 10, 11],
        [12, 13, 14, 15]])

> But if you want to use python to replace matlab, you should look in to
> numpy.

 From his use of array() I would guess he already has done that.

Kent
_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to