On Tue, 28 Sep 2010 11:55:18 -0700 (PDT) Toto emays...@gmail.com
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
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,
--
--
On Tue, Sep 28, 2010 at 11:55 AM, Toto emays...@gmail.com 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)
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...
--
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
heu the zip trick actually works... my mistake!
--
http://mail.python.org/mailman/listinfo/python-list
Toto emays...@gmail.com 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