[SciPy-dev] matrix and ravel()

Fernando Perez Fernando.Perez at colorado.edu
Tue Oct 11 21:26:36 EDT 2005


Robert Kern wrote:
> In [1]: A = array([[1,2],[3,4]])
> 
> In [2]: B = mat(A)
> 
> In [3]: ravel(A)
> Out[3]: array([1, 2, 3, 4])
> 
> In [4]: ravel(B)
> Out[4]: matrix([[1, 2, 3, 4]])
> 
> This appears to be a side effect of the new __array_finalize__ magic.
> I'm not sure that it's desirable. I'm also not sure that it's desirable
> to change it.

Well, at least I hope it gets changed, or a lot of code which expects ravel to 
produce a flat, one-d array will blow to pieces.

Cheers,

f




More information about the SciPy-Dev mailing list