Closed eltxejo closed 1 year ago
Hi there, @eltxejo. Apologies that it has been some time since you opened this issue.
The SingleMatching
class is effectively a dictionary already. However, if you would like to create one and export the players using their names, this should do the trick:
from matching.games import StableMarriage
game = StableMarriage(players)
matching = game.solve()
matching_dict = {player.name: match.name for player, match in matching.items()}
It may be worth me adding a how-to with this to the documentation!
That made it!
Thank you, @daffidwilde
Hi there,
Once the Stable Marriage game is solved, I would like to retrieve the solution data into a Python dictionary in order to manipulate the data for further actions.
How could I do it?
Thanks