[Numpy-discussion] How do I make a diagonal matrix?

Alan G Isaac aisaac at american.edu
Fri Jun 23 17:34:26 EDT 2006


> Alan G Isaac wrote: 
>> I can roughly understand why a.ravel() returns a matrix; 
>> but is there a good reason to forbid truly flattening the matrix? 

On Fri, 23 Jun 2006, Travis Oliphant apparently wrote: 
> Because matrices are never 1-d.  This is actually pretty 
> consistent behavior. 

Yes; that's why I can understand ravel.
But I was referring to flat with the question.



On Fri, 23 Jun 2006, Travis Oliphant apparently wrote: 
> I think you are right that this is a bug, though.  Because 
> __array__() (which is where the behavior comes from) 
> should return a base-class array (not a sub-class). 

Thanks for fixing this!!

Alan






More information about the NumPy-Discussion mailing list