[Numpy-discussion] Ransom Proposals

Tim Hochberg tim.hochberg at cox.net
Sun Mar 26 19:02:06 CST 2006


Travis Oliphant wrote:

> Sasha wrote:
>
>> I never said that. What I said was x.reshape(shape) returns x itself
>> if shape==x.shape and a view othrwise.  
>
> Is this true?  I just checked on it and it didn't seem to be the 
> case.  Perhaps this was "fixed" during the recent reshape bug-fix.

It was at least true in the fairly recent past:

 >>> numpy.__version__
'0.9.7.2275'
 >>> a = numpy.arange(9)
 >>> b = a.reshape(a.shape)
 >>> b is a
True
 >>> c = a.reshape((3,3))
 >>> c is a
False

I can't get through to svn.scipy.org right now to do an update, so I 
can't check on current SVN, but I believe that this version is less than 
a week old.

-tim







More information about the Numpy-discussion mailing list