reshape an array?

Robert Kern robert.kern at
Wed Mar 8 20:16:22 CET 2006

KraftDiner wrote:
> I have a 2D array.  Say it is 10x10 and I want a 1D Array of 100
> elements...
> What is the syntax?
> oneD = reshape(twoD, (100,1))
> or
> oneD = reshape(twoD, (1,100))
> One I guess is the transpose of the other but both seem to be
> arrays of arrays...


  oneD = ravel(twoD)

Robert Kern
robert.kern at

"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 Python-list mailing list