[Numpy-discussion] Characteristic of a Matrix.

cjw cjw at ncf.ca
Mon Jan 5 19:52:33 EST 2015


On 05-Jan-15 1:56 PM, David€id wrote:
> On 5 January 2015 at 20:40, Colin J. Williams <cjwilliams43 at gmail.com>
> wrote:
>
>> This illustrates a failure, which is reported later in the calculation:
>>
>> A2= np.matrix([[1, 2, -2], [-3, -1, 4], [4, 2 -6]])
>>
>> Here 2 - 6 is treated as an expression.
>>
> There should be a comma between 2 and -6. The rectangularity is checked,
> and in this case, it is not fulfilled. As such, NumPy creates a square
> matrix of size 1x1 of dtype object.
>
> If you want to make sure what you have manually inputed is correct, you
> should include a couple of assertions afterwards.
>
> /David.
David,

Thanks.  My suggestion was that numpy should do that checking,

Colin W.
>




More information about the NumPy-Discussion mailing list