About 50 results
Open links in new tab
  1. python - Difference between zip (list) and zip (*list) - Stack Overflow

    Mar 19, 2015 · The zip function takes n lists and creates n-tuple pairs from each element from both lists: zip ( [iterable, ...]) This function returns a list of tuples, where the i-th tuple contains …

  2. Zip lists in Python - Stack Overflow

    I am trying to learn how to "zip" lists. To this end, I have a program, where at a particular point, I do the following: x1, x2, x3 = stuff.calculations(withdataa) This gives me three lists, x1, x...

  3. Why does x,y = zip(*zip(a,b)) work in Python? - Stack Overflow

    I'm extremely new to Python so this just recently tripped me up, but it had to do more with how the example was presented and what was emphasized. What gave me problems with …

  4. For loop and zip in python - Stack Overflow

    Q1- I do not understand "for x, y in zip (Class_numbers, students_per_class)". Is it like a 2d for loop? why we need the zip? Can we have 2d loop with out zip function? Q2-I am not …

  5. How does zip(*[iter(s)]*n) work in Python? - Stack Overflow

    10 iter(s) returns an iterator for s. [iter(s)]*n makes a list of n times the same iterator for s. So, when doing zip(*[iter(s)]*n), it extracts an item from all the three iterators from the list in order. …

  6. python - How do I iterate through two lists in parallel ... - Stack ...

    Python 3 for f, b in zip(foo, bar): print(f, b) zip stops when the shorter of foo or bar stops. In Python 3, zip returns an iterator of tuples, like itertools.izip in Python2. To get a list of tuples, use …

  7. How do I sort a zipped list in Python? - Stack Overflow

    Apr 29, 2017 · How do I sort a zipped list in Python? Asked 14 years, 1 month ago Modified 4 years, 11 months ago Viewed 82k times

  8. python - Download Returned Zip file from URL - Stack Overflow

    Feb 23, 2012 · If I have a URL that, when submitted in a web browser, pops up a dialog box to save a zip file, how would I go about catching and downloading this zip file in Python?

  9. python - How to extract zip file recursively? - Stack Overflow

    18 I have a zip file which contains three zip files in it like this: zipfile.zip\ dirA.zip\ a dirB.zip\ b dirC.zip\ c I want to extract all the inner zip files that are inside the zip file in directories with …

  10. python - How to create a zip archive of a directory? - Stack Overflow

    Dec 6, 2009 · How can I create a zip archive of a directory structure in Python? In a Python script In Python 2.7+, shutil has a make_archive function. from shutil import make_archive …