[SciPy-user] Shape Problem
excellent.frizou at gmail.com
Wed Oct 18 09:53:44 CDT 2006
Actually, my matrix M comes from a ndarray N:
So, M is not a numpy.matrix object (for which I do not have this shape
problem), but a numpy.core.defmatrix.matrix object (for wich I have
the shape problem).
Maybe there exists a way to really cast a ndarray into a numpy.matrix object ?
On 10/18/06, Louis Pecora <pecora at anvil.nrl.navy.mil> wrote:
> Sam frizou wrote:
> > Hi,
> > I use a matrix M of shape (20,25).
> > If I do N=M[18:,18:] I correctly obtain the submatrix of M of shape (2,7).
> > Now, if I do N=M[19:,19:], I expect to have the submatrix of M of
> > shape (1,6) but the shape of N is (6,1).
> > Is there any way to obtain the correct shape in any case ?
> > Thank you very much for your help.
> > Sam
> I just tried this (MacOS X 10.4, Python 2.4, NumPy) and got the right
> answer (1,6). What modules are you using? Might need an upgrade there.
> Lou Pecora
> Code 6362
> Naval Research Lab
> Washington, DC 20375
> Ph: +202-767-6002
> email: pecora at anvil.nrl.navy.mil
> SciPy-user mailing list
> SciPy-user at scipy.org
On obtient beaucoup plus avec un mot gentil et une arme qu'avec
seulement un mot gentil - "Al Capone".
More information about the SciPy-user