numpy.matlib.ones()This function is used to return a new matrix with the values initialized to ones. SyntaxParametersIt accepts the following parameters.
ReturnA matrix is returned with all the entries initialized to 1. ExampleOutput: [[1. 1. 1.] [1. 1. 1.] [1. 1. 1.]] Example: initializing integer valuesOutput: [[1 1 1] [1 1 1] [1 1 1]] Example: specifying Insertion orderOutput: [[1 1 1] [1 1 1] [1 1 1]] Next Topicnumpy.matlib.zeros() |