vice.migration.migration_matrix.tonumpyarray

Obtain a copy of this migration matrix as a NumPy array.

Signature: x.tonumpyarray()

Parameters

xmigration_matrix

An instance of this class.

Returns

copynumpy.ndarray

A NumPy array which stores the same values as x.

Raises

  • ModuleNotFoundError [ImportError for python < 3.6]
    • NumPy could not be imported.

Example Code

>>> import vice
>>> example = vice.migration.migration_matrix(3)
>>> example.tonumpyarray()
        array([[0, 0, 0],
                [0, 0, 0],
                [0, 0, 0]])