Alan G Isaac wrote:

>>Alan G Isaac wrote: 
>>    
>>
>>>Hmm. One would think that diag() would accept a flatiter 
>>>object, but it does not.  Shouldn't it?? 
>>>      
>>>
>
>
>On Fri, 23 Jun 2006, Travis Oliphant apparently wrote: 
>  
>
>>It doesn't? 
>>try: 
>>a = rand(3,4) 
>>diag(a.flat).shape 
>>    
>>
>
>OK, but then try:
>  
>
>>>>a=N.mat(a)
>>>>N.diag(a.flat).shape
>>>>        
>>>>
>(1,)
>
>Why is a.flat not the same as a.A.flat?
>  
>

It is the same object except for the pointer to the underlying array.  
When asarray(a.flat) get's called it looks to the underlying array to 
get the sub-class and constructs that sub-class (and matrices can never 
be 1-d).  Thus, it's a "feature"


-Travis


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion

Reply via email to