pygambit.gambit.StrategicGame.from_arrays#

classmethod StrategicGame.from_arrays(*arrays, title: str = 'Untitled strategic game') → StrategicGame#

Create a new strategic game from payoff arrays.

Each entry in arrays gives the payoff matrix for the corresponding player. The arrays must all have the same shape, and have the same number of dimensions as the total number of players.

Players are labeled "1", "2", and so on; each player’s strategies are likewise labeled "1", "2", and so on.

Changed in version 16.1.0: Added the title parameter.

Changed in version 17.0.0: Replaces Game.from_arrays.

Parameters:
  • arrays (array-like of array-like) – The 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:

StrategicGame

See also

from_dict

Create strategic game and set player labels

Game.to_arrays

Generate the payoff tables for players represented as numpy arrays