numpy.matlib.eye()This function returns a matrix with the diagonal elements initialized to 1 and zero elsewhere. SyntaxParametersIt accepts the following parameters.
ReturnA matrix with uninitialized entries is returned. ExampleOutput: [[1 0 0] [0 1 0] [0 0 1]] Example: Initializing float valuesOutput: [[1. 0. 0.] [0. 1. 0.] [0. 0. 1.]] Next Topicnumpy.matlib.identity() |