pygambit.gambit.StrategicGame.from_dict#
- classmethod StrategicGame.from_dict(payoffs, title: str = 'Untitled strategic game') StrategicGame#
Create a new strategic game from a dict of payoff arrays.
Each entry in payoffs is a key-value pair giving the label and the payoff matrix for a player. The payoff matrices must all have the same shape, and have the same number of dimensions as the total number of players.
The players are labeled with the keys of payoffs, and therefore must be valid player labels. Each player’s strategies are labeled
"1","2", and so on.Changed in version 17.0.0: Replaces Game.from_dict.
- Parameters:
payoffs (dict-like mapping str to array-like) – The names and corresponding payoff matrices for the players.
title (str, optional) – The title of the game. If no title is specified, “Untitled strategic game” is used.
- Returns:
The newly-created strategic game.
- Return type:
See also
from_arraysCreate game from list-like of array-like
