[Numpy-discussion] column_stack with mixed data types

Robert Kern robert.kern at gmail.com
Mon Jul 30 19:10:42 EDT 2007


Ryan Krauss wrote:
> I just tend to think in terms of lists rather than tuples.  Why is a
> tuple a more reasonable choice than a list?  (I'm really asking and
> not being argumentative, since you can't hear my tone.)

The key thing is that the type of the container of records is different from the
type of the record, so you'd either have to have a list of tuples (or a list of
lists of ... tuples) or a tuple of lists. There is a tendency to use lists for
homogeneous collections and tuples for inhomogeneous collections; Guido says
that this is the main difference in how he uses tuples and lists. When you get
an answer to a DB-API2 SQL query, you get a list of (usually augmented) tuples.

-- 
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