Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

8
  • 3
    What did you try? Commented Mar 24, 2017 at 23:21
  • 2
    Welcome to Stack Overflow. We're not a code writing service, so please review How to Ask and show us what you've tried. Commented Mar 24, 2017 at 23:23
  • take your output from itertools.permutations and pass it to the built in set() function, that will get rid of duplicates. Commented Mar 24, 2017 at 23:26
  • Thanks for the comments. I've tried calling itertools permutations on my array, but that returns all possible combinations where only the row is unique. I also began writing a recursive loop but then scrapped it early on: my real data set is very large and I need something more memory efficient. Commented Mar 25, 2017 at 19:55
  • If your real data set is very large this whole thing is bound to fail. Numbers of permutations grow very quickly. Commented Mar 25, 2017 at 20:06