[Numpy-discussion] Will transpose ever need to copy data?
Wed Jun 12 07:31:19 CDT 2013
On Wed, Jun 12, 2013 at 1:24 PM, Sebastian Berg
> On Tue, 2013-06-11 at 09:24 -0700, Jaime Fernández del Río wrote:
>> I noticed today that the documentation for np.transpose states, for
>> the return value, that "A view is returned whenever possible."
> I guess a subclass could cause a copy (the code looks like subclassing
> doing something fancy is not be anticipated, there may be a bug here),
> other then that, I don't see a reason for this comment. Transposing is
> always possible for strided memory patterns and a copy will never occur.
Indeed, there is no codepath in PyArray_Transpose() that even
contemplates a memory copy.
More information about the NumPy-Discussion