[Numpy-discussion] flatten() without copy - is this possible?
Fri Jun 8 20:22:12 CDT 2007
On 05/06/07, Charles R Harris <email@example.com> wrote:
> On 6/5/07, dmitrey <firstname.lastname@example.org> wrote:
> > Thank you, but all your examples deal with 3-dimensional arrays. and I
> > still misunderstood, is it possible somehow for 2-dimensional arrays or
> > D.
> There is nothing special about the number of dimensions, all arrays have the
> same methods..
Of course. But he was asking whether the examples I was giving, of
arrays that could and couldn't be flattened, would work in 2D.
There is nothing special about 3D; there are 2D matrices that can be
flattened and 2D matrices that can't. Think about the matrix in terms
of strides and lengths specifying how the elements are laid out in
memory and things should become much clearer. I suspect the numpy book
(which is not expensive) does a better job of explaining it.
More information about the Numpy-discussion