[Numpy-discussion] is it a bug?

Robert Kern robert.kern at gmail.com
Wed Mar 11 22:57:42 EDT 2009


On Wed, Mar 11, 2009 at 21:51, Jonathan Taylor
<jonathan.taylor at utoronto.ca> wrote:
> You lost me on
>> x = np.arange(30)
>> x.shape = (2,3,5)
>
> For me I get:
> In [2]: x = np.arange(30)
>
> In [3]: x.shape
> Out[3]: (30,)
>
> which is what I would expect.   Perhaps I missed something?

He is reshaping x by assigning (2,3,5) to its shape tuple, not
asserting that it is equal to (2,3,5) without modification.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
  -- Umberto Eco



More information about the NumPy-Discussion mailing list