|
From: Stefan v. d. W. <st...@su...> - 2006-02-23 11:57:07
|
On Thu, Feb 23, 2006 at 01:31:47PM +0200, Albert Strasheim wrote:
> More than 2 dimensions is tricky, since NumPy and MATLAB don't seem to
> agree on how more-dimensional data is organised? As such, I don't know
> what a NumPy user would expect repmat to do with more than 2
> dimensions.
To expand on this, here is what I see when I create (M,N,3) matrices
in both octave and numpy. I expect to see an MxN matrix stacked 3
high:
octave
------
octave:1> zeros(2,2,3))
ans =3D
ans(:,:,1) =3D
0 0
0 0
ans(:,:,2) =3D
0 0
0 0
ans(:,:,3) =3D
0 0
0 0
numpy
-----
In [19]: zeros((2,3,3))
Out[19]:
array([[[0, 0, 0],
[0, 0, 0],
[0, 0, 0]],
[[0, 0, 0],
[0, 0, 0],
[0, 0, 0]]])
There is nothing wrong with numpy's array -- but the output generated
seems counter-intuitive.
St=E9fan
|