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 |
---|---|
Returns: |
out : matrix
|
See also
numpy.identity
matlib.eye
>>> import numpy.matlib >>> np.matlib.identity(3, dtype=int) matrix([[1, 0, 0], [0, 1, 0], [0, 0, 1]])
© 2008–2017 NumPy Developers
Licensed under the NumPy License.
https://docs.scipy.org/doc/numpy-1.13.0/reference/generated/numpy.matlib.identity.html