About 1,580,000 results
Open links in new tab
  1. How do I generate all permutations of a list? - Stack Overflow

    Use itertools.permutations from the standard library: import itertools list(itertools.permutations([1, 2, 3]))

  2. Finding all possible permutations of a given string in python

    Nov 29, 2011 · Here's a slightly improved version of illerucis 's code for returning a list of all permutations of a string s with distinct characters (not necessarily in lexicographic sort order), …

  3. All possible permutations of a set of lists in Python

    May 17, 2010 · In Python I have a list of n lists, each with a variable number of elements. How can I create a single list containing all the possible permutations: For example [ [ a, b, c], [d], [e, f] ] …

  4. python - How do I generate permutations of length LEN given a …

    Aug 4, 2014 · How do I generate permutations of length LEN given a list of N Items? Asked 13 years, 7 months ago Modified 4 years, 8 months ago Viewed 42k times

  5. python - Generating all permutations efficiently - Stack Overflow

    Oct 10, 2020 · I need to generate as fast as possible all permutations of integers 0, 1, 2, ..., n - 1 and have result as a NumPy array of shape (factorial(n), n), or to iterate through large portions …

  6. python - Get all permutations of a numpy array - Stack Overflow

    Dec 18, 2016 · Get all permutations of a numpy array Asked 8 years, 10 months ago Modified 1 year, 5 months ago Viewed 68k times

  7. permutations of two lists in python - Stack Overflow

    Dec 23, 2009 · permutations of two lists in python Asked 15 years, 10 months ago Modified 2 years, 10 months ago Viewed 88k times

  8. How do i create a permutation on Python without using the …

    Check out permutations at rosettacode.org. Granted, for python, it uses itertools, but for low-level languages, it gives the algorithm that you could easily port to python.

  9. python - How can I get "permutations with …

    Details Unobviously, Cartesian product can generate subsets of permutations. However, it follows that: with replacement: produce all permutations n r via product without replacement: filter from …

  10. Python recursion permutations - Stack Overflow

    6 You can use a function that iterates an index through the list, and yield a list consisting of the value at the index followed by the permutations of the rest of the list values. Below is an …