[Numpy-discussion] .data doesn't account for .transpose()?
Thu Mar 29 17:48:25 CDT 2007
On 29/03/07, Robert Kern <firstname.lastname@example.org> wrote:
> Glen W. Mabey wrote:
> > So, would that imply that a .copy() should be done first on any array
> > that you want to access .data on?
> Or even ascontiguousarray().
I'd like to point out that the numpy usage of the word "contiguous" is
a bit misleading: while naively one would expect it to mean that the
data were contiguous in memory, what it actually means is that they
are contiguous and the indexing is C-ordered:
In : a = arange(5)
In : a.flags["CONTIGUOUS"]
In : a[::-1].flags["CONTIGUOUS"]
In : eye(2).flags["CONTIGUOUS"]
In : transpose(eye(2)).flags["CONTIGUOUS"]
There's no help for it now, I suppose.
More information about the Numpy-discussion