In several of the matplotlib examples, I encounter statements using
the built-in Python zip function. The really cool use is shown below.
a = [(0,0),(1,2),(4,3)]
zip(*a)
[(0, 1, 4), (0, 2, 3)]
Now this use of '*a' as argument does not seem to be documented anywhere.
How does it work? Why do you need the * ? Probably really simple, I
just don't understand.
Thanks for any help,
Mark
Mark Bakker wrote:
In several of the matplotlib examples, I encounter statements using
the built-in Python zip function. The really cool use is shown below.
a = [(0,0),(1,2),(4,3)]
zip(*a)
[(0, 1, 4), (0, 2, 3)]
Now this use of '*a' as argument does not seem to be documented anywhere.
How does it work? Why do you need the * ? Probably really simple, I
just don't understand.
http://docs.python.org/tut/node6.html#SECTION006740000000000000000
ยทยทยท
--
Robert Kern
rkern@...376...
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter