Re: Reoedering indexes in list of list

2010-09-29 Thread Andreas Waldenburger
On Tue, 28 Sep 2010 11:55:18 -0700 (PDT) Toto wrote: > Hello, > > I have a list of list > assume myList[x][y] is integer > I would like to create an alias to that list which I could call this > way: > alias[y][x] returns myList[x][y] > > how can I do that ? (python 2.6) > > (I have a feeling I

Re: Reoedering indexes in list of list

2010-09-28 Thread Arnaud Delobelle
Toto writes: >> If your "alias" can be read-only: >> alias = zip(*myList) > > > > a=[['00','01'],['10','11']] > l=zip(*a) > print(l) > > returns... [('00', '10'), ('01', '11')] > > IS NOT AT ALL WHAT I WANT ;-) > > What I want is > > print a[1][0] > '10' > but print l[1][0] > '01' > > notice the

Re: Reoedering indexes in list of list

2010-09-28 Thread Toto
heu the zip trick actually works... my mistake! -- http://mail.python.org/mailman/listinfo/python-list

Re: Reoedering indexes in list of list

2010-09-28 Thread Toto
again I want: alias[y][x] returns myList[x][y] > print a[1][0] > '10' > but print l[1][0] > '01' > > notice the indexes  of the list l are inverted... -- http://mail.python.org/mailman/listinfo/python-list

Re: Reoedering indexes in list of list

2010-09-28 Thread Toto
> If your "alias" can be read-only: > alias = zip(*myList) a=[['00','01'],['10','11']] l=zip(*a) print(l) returns... [('00', '10'), ('01', '11')] IS NOT AT ALL WHAT I WANT ;-) What I want is print a[1][0] '10' but print l[1][0] '01' notice the indexes of the list l are inverted... -- h

Re: Reoedering indexes in list of list

2010-09-28 Thread Chris Rebert
On Tue, Sep 28, 2010 at 11:55 AM, Toto wrote: > Hello, > > I have a list of list > assume myList[x][y] is integer > I would like to create an alias to that list which I could call this > way: > alias[y][x] returns myList[x][y] If your "alias" can be read-only: alias = zip(*myList) Cheers, Chris

Reoedering indexes in list of list

2010-09-28 Thread Toto
Hello, I have a list of list assume myList[x][y] is integer I would like to create an alias to that list which I could call this way: alias[y][x] returns myList[x][y] how can I do that ? (python 2.6) (I have a feeling I should use 'property' ;) Thanks, -- -- http://mail.python.org/mailman/list