Re: What is the slickest way to transpose a square list of lists (tuple of tuples)?

2006-01-09 Thread gene tani
Gerard Brunick wrote: > My way is ugly. These has to be a better way. > > Thanks, > Gerard transpose funcitons/methods: http://numeric.scipy.org/ http://numpy.sourceforge.net/numdoc/numdoc.pdf -- http://mail.python.org/mailman/listinfo/python-list

Re: What is the slickest way to transpose a square list of lists (tuple of tuples)?

2006-01-09 Thread Dave Hansen
On Sun, 08 Jan 2006 14:27:55 -0500 in comp.lang.python, Gerard Brunick <[EMAIL PROTECTED]> wrote: >My way is ugly. These has to be a better way. This may not be the "slickest" way, but I needed some practice with list comprehensions (I've never really gotten used to them...) This works with lis

Re: What is the slickest way to transpose a square list of lists (tuple of tuples)?

2006-01-08 Thread Bengt Richter
On Sun, 08 Jan 2006 15:21:59 -0600, Brian van den Broek <[EMAIL PROTECTED]> wrote: >Gerard Brunick said unto the world upon 08/01/06 01:27 PM: >> My way is ugly. These has to be a better way. >> >> Thanks, >> Gerard > >If you'd posted your way, I might well have seen if I could do it in a >nic

Re: What is the slickest way to transpose a square list of lists (tuple of tuples)?

2006-01-08 Thread Tim Hochberg
Brian van den Broek wrote: > Gerard Brunick said unto the world upon 08/01/06 01:27 PM: > >>My way is ugly. These has to be a better way. >> >>Thanks, >>Gerard > > > If you'd posted your way, I might well have seen if I could do it in a > nicer fashion. But, since for all I know, my best effor

Re: What is the slickest way to transpose a square list of lists (tuple of tuples)?

2006-01-08 Thread Claudio Grondi
Gerard Brunick wrote: > My way is ugly. These has to be a better way. > > Thanks, > Gerard Ugly is not necessary not the slickest. To do better, there must be something to compare to, right? Claudio -- http://mail.python.org/mailman/listinfo/python-list

Re: What is the slickest way to transpose a square list of lists (tuple of tuples)?

2006-01-08 Thread Brian van den Broek
Gerard Brunick said unto the world upon 08/01/06 01:27 PM: > My way is ugly. These has to be a better way. > > Thanks, > Gerard If you'd posted your way, I might well have seen if I could do it in a nicer fashion. But, since for all I know, my best efforts would result in the approach you alre

What is the slickest way to transpose a square list of lists (tuple of tuples)?

2006-01-08 Thread Gerard Brunick
My way is ugly. These has to be a better way. Thanks, Gerard -- http://mail.python.org/mailman/listinfo/python-list

Re: lists <-> tuple

2005-11-05 Thread Peter Notebaert
"Robert Kern" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Peter Notebaert wrote: >> I am new to Python and have to create an import library in C that uses >> matrices. >> >> These matrices can be one-dimensional (vectors) or two-dimensional. If I >> look in the ActivePython 2.4

Re: lists <-> tuple

2005-11-05 Thread Peter Notebaert
"Jim" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >> Tuples or lists for matrix-like functionality? > > Use lists. Tuples are meant for small immutable sets of things that go > together. Lists are more like arrays, and you can assign to one > existing element if you want. > > On

Re: lists <-> tuple

2005-11-02 Thread Robert Kern
Peter Notebaert wrote: > I am new to Python and have to create an import library in C that uses > matrices. > > These matrices can be one-dimensional (vectors) or two-dimensional. If I > look in the ActivePython 2.4 documentation at data structures, then I see at > least 2 posibilities to repre

Re: lists <-> tuple

2005-11-02 Thread Jim
> Tuples or lists for matrix-like functionality? Use lists. Tuples are meant for small immutable sets of things that go together. Lists are more like arrays, and you can assign to one existing element if you want. One exception, is a short vector is often a tuple like (x, y, z) and you might wa

lists <-> tuple

2005-11-02 Thread Peter Notebaert
I am new to Python and have to create an import library in C that uses matrices. These matrices can be one-dimensional (vectors) or two-dimensional. If I look in the ActivePython 2.4 documentation at data structures, then I see at least 2 posibilities to represent them: Lists and Tuples. The d