reshape an array?
Robert Kern
robert.kern at gmail.com
Wed Mar 8 14:15:49 EST 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...
The mailing list for numpy is numeric-discussion at lists.sourceforge.net, and you
may get faster/better help there. But:
oneD = reshape(twoD, (100,))
--
Robert Kern
robert.kern at gmail.com
"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