[Numpy-discussion] matrix vs. array

Travis Oliphant oliphant.travis at ieee.org
Wed Mar 15 11:35:05 CST 2006


Andrew Straw wrote:
> Bill Baxter wrote:
>
>   
>> On 3/15/06, *Paulo J. S. Silva* <pjssilva at ime.usp.br
>> <mailto:pjssilva at ime.usp.br>> wrote:
>>
>>
>>     > The other difference which isn't really obvious from looking at the
>>     > source code is that matrices always have at least rank
>>
>>     Just to make clear. They *always* have rank two.
>>
>>
>> Not necessarily.
>>
>>     
>>>>> m = numpy.matrix('[1 2 3; 4 5 6]')
>>>>> mm = m[numpy.matrix('[0 1]')]
>>>>> m
>>>>>           
>> matrix([[1, 2, 3],
>>        [4, 5, 6]])
>>     
>>>>> mm
>>>>>           
>> matrix([[[[1, 2, 3]],
>>
>>         [[4, 5, 6]]]])
>>     
>>>>> mm.shape
>>>>>           
>> (1, 2, 1, 3)
>>
>>     
> Could you enter this as a bug so it doesn't get forgotten?
> http://projects.scipy.org/scipy/numpy/newticket
>   

Please check to see if it actually is still broken.   I think it's fixed.


-Travis

> Cheers!
> Andrew
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting language
> that extends applications into web and mobile media. Attend the live webcast
> and join the prime developer group breaking into this new coding territory!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/numpy-discussion
>   





More information about the Numpy-discussion mailing list