19 Dec
2008
19 Dec
'08
5:31 p.m.
I just stumbled across the following behaviour: from scipy import * a=array([0,1]) m=matrix([0,1]) # this works: a=a+m a #[Out]# matrix([[0, 2]]) a=array([0,1]) # this works too m+=a m #[Out]# matrix([[0, 2]]) # however, this does not work: a+=m I get: <type 'exceptions.ValueError'>: invalid return array shape Can anyone explain me why it is implemented this way? I mean, it is not that intuitive. Bastian