numpy.matlib.identity()

numpy.matlib.identity

numpy.matlib.identity(n, dtype=None) [source]

Returns the square identity matrix of given size.

Parameters:

n : int

Size of the returned identity matrix.

dtype : data-type, optional

Data-type of the output. Defaults to float.

Returns:

out : matrix