Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8058729
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:26:48+00:00 2026-06-05T09:26:48+00:00

I am trying pairwise testing and wanted Python based pairwise testing tool. I already

  • 0

I am trying pairwise testing and wanted Python based pairwise testing tool. I already tried AllPairs(http://pypi.python.org/pypi/AllPairs/2.0.1). It has bug when I give 10 entries in a Column. Currently using Microsoft PICT to generate pairwise combination.

Is there any tool in Python that generates pairwise combinations for large arrays?

Bug in AllPairs
If I give this

parameters = [ [ "Brand X", "Brand Y","Brand A","Brand B","Brand C","Brand D" ]
             , [ "98", "NT", "2000", "XP"]
             , [ "Internal", "Modem","A","B","C","D","E","F","G","H","I","J","K","L","M" ]
             , [ "Salaried", "Hourly", "Part-Time", "Contr.","AA","BB","CC","DD","EE","FF","GG","HH","II" ]
             , [ 6, 10, 15, 30, 60, 70, 80, 90, 100, 110, 120, 130, 140 ]
             ]

Output is

Brand X count is 16
Brand Y count is 122
Brand A count is 16
Brand B count is 16
Brand C count is 16
Brand D count is 15

for this

parameters = [ [ "Brand X", "Brand Y","Brand A","Brand B","Brand C","Brand D" ]
             , [ "98", "NT", "2000", "XP"]
             , [ "Internal", "Modem" ]
             , [ "Salaried", "Hourly", "Part-Time", "Contr." ]
             , [ 6, 10, 15, 30, 60 ]
             ]

output is

Brand X count is 5
Brand Y count is 5
Brand A count is 5
Brand B count is 5
Brand C count is 5
Brand D count is 6

I think, it is not correct working for larger array.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T09:26:49+00:00Added an answer on June 5, 2026 at 9:26 am

    How about something like this?

    from itertools import chain, combinations, product
    
    def pairwiseGen(*sequences):
        unseen = set(chain.from_iterable(product(*i) for i in combinations(sequences, 2)))
        for path in product(*sequences):
            common_pairs = set(combinations(path, 2)) & unseen
            if common_pairs:
                yield path
                unseen.difference_update(common_pairs)
    

    Usage (using the parameters list you defined in your question):

    >>> pairs = list(pairwiseGen(*parameters))
    >>> len(pairs)
    846
    

    I think there is still some room for optimization (the above generator yielded slightly more results than were expected), but I think you’ll agree that it’s much shorter than using the cartesian product:

    >>> all_possible = list(product(*parameters))
    >>> len(all_possible)
    60480
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to generate pairwise combinations of rows on based on their ids. SQLite
I am trying to implement protein pairwise sequence alignment using Global Alignment algorithm by
Trying to install py-bcrypt on win7. Python is 64bit. First error unable to find
Trying to get Nunit working in ASP.Net. The problem is, I'm testing a custom
Trying to make a MySQL-based application support MS SQL, I ran into the following
Trying to create a QtRuby application, I get the following error: /usr/lib64/ruby/site_ruby/1.8/Qt/qtruby4.rb:2144: [BUG] Segmentation
trying to get a regex that will match a url e.g. 'http://www.test.com' and then
Trying to do a simple insert, and this one line is giving me issues.
Trying to convert a perl script to php. In perl I have a hash
Trying to display a message if no results found in the search query. Here

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.