reshape a list?

Robert Kern robert.kern at
Tue Mar 7 05:31:36 CET 2006

Michael Spencer wrote:
> Robert Kern wrote:
>>KraftDiner wrote:
>>>I have a list that starts out as a two dimensional list
>>>I convert it to  a 1D list by:
>>>b = sum(a, [])
>>>any idea how I can take be and convert it back to a 2D list?
>>Alternatively, you could use real multidimensional arrays instead of faking it
>>with lists.
> Or, you can fake real multidimensional arrays with lists ;-)
> pyarray is a pure-Python single-module implementation of a multi-dimensional 
> array type.
> Download from

That's fine, too.  :-)

It's just that trying to do it *again* is a silly waste of time.

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