I'm probably not using the right keywords to find something useful on this (as you might be able to tell from the awkward title), so here it goes:
How could I represent values for pairs from a single list? For example, the list could be a league of teams (say Red, Gold and Blue to keep it short) playing against each other and the values the result of each game. Each list item (team) is paired with all others, and each pairing corresponds to a value, which we can call the result. And the normal way one would use this structure would be to pick two teams to look up the result of the match. Pairs are not ordered and teams have no special status.
The most obvious thing would be a table (e.g., I'm using Pandas, so a dataframe), but it feels a bit awkward because it would have to be half-full if we're avoiding repetition.
The "teams" could possibly have two "games" between them (which is common in sports, anyway), but in this case, I think a table would be even worse because we'd have to assign some meaning to the parts above and below the diagonal (say, "round 1" and "round 2"), and it's not generalizable to even more matches (that should be done with an additional variable on top of the "single" list).
What's a "natural" (in lieu of a better term) way to represent this? (By this, I mean the original table, i.e., unordered pairs from a single list.)
P.S.: I mentioned dataframes, but the question would apply to any type of "table" (e.g., dict of dicts).
P.S.2: I mentioned "teams" for illustration purposes only. Please avoid discussions of sport-related issues!


l = ['red', 'blue', 'green'], are you looking for something like this[('red', 'blue'), ('red', 'green'), ('blue', 'green')]?