You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Daniel Flassig edited this page Jun 24, 2026
·
1 revision
Creates the n × n identity matrix.
This function is located in the pymath module. See pymath for the matrix representation.
I=pymath.identity(n)
Parameter
Type
Description
n
integer
The size of the (square) identity matrix. Must be ≥ 1.
Return value
Type
Description
I
A new n × n identity matrix (1 on the diagonal, 0 elsewhere).
Notes:
For n ≤ 10 a dense matrix is returned. For larger n a sparse matrix is returned (a size field plus one entry per row); both forms are accepted as input by the other pymath functions.