AnalystPath

Every Debate Pairing in the Tournament

PandasEasyJunior level~10 min

Problem

You are given a DataFrame `clubs` with a single column `club_name`. In a debate tournament every two clubs face each other twice: once with the first club as the `affirmative` side and once as the `negative` side. Return every ordered pairing of two different clubs as a DataFrame with columns `affirmative` and `negative`. A club is never paired with itself. The order of rows does not matter.

Input data

Example rows — the live problem includes the full dataset.

clubs
club_name
Northgate
Riverside
Hilltop

Expected output

Your answer should return 6 rows with the columns affirmative, negative.

Starter code (Pandas (Python))

import pandas as pd

def every_pairing(clubs) -> pd.DataFrame:
    # Your code here
    return clubs

Solve this Pandas question free

Write Pandas (Python) and run it instantly in your browser — even on your phone. No signup needed to try.

Solution & explanation

Create a free account to unlock the optimal solution, a step-by-step explanation, and the hidden test cases that grade your answer.

Sign up free to unlock

Related Pandas questions