{"id":27535,"date":"2022-08-16T00:03:09","date_gmt":"2022-08-15T18:33:09","guid":{"rendered":"https:\/\/python-programs.com\/?p=27535"},"modified":"2022-08-16T00:03:09","modified_gmt":"2022-08-15T18:33:09","slug":"python-numpy-matrix-put-function","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-numpy-matrix-put-function\/","title":{"rendered":"Python Numpy matrix.put() Function"},"content":{"rendered":"

NumPy Library\u00a0<\/strong><\/p>\n

NumPy is a library in python that is created to work efficiently with arrays in python. It is fast, easy to learn, and provides efficient storage. It also provides a better way of handling data for the process. We can create an n-dimensional array in NumPy. To use NumPy simply have to import it into our program and then we can easily use the functionality of NumPy in our program.<\/p>\n

NumPy is a Python library that is frequently used for scientific and statistical analysis. NumPy arrays are grids of the same datatype\u2019s values.<\/p>\n

Numpy matrix.put() Function:<\/strong><\/p>\n

Using the matrix.put() method of the Numpy module, we can put(insert) the value by passing index and value in a given particular matrix.<\/p>\n

Syntax:<\/strong><\/p>\n

 matrix.put(index, value)<\/pre>\n

Return Value:<\/strong><\/p>\n

A new matrix (after putting values ) is returned by the put() function.<\/p>\n

Numpy matrix.put() Function in Python<\/h2>\n

For 2-Dimensional (2D) Matrix (Inserting an element at Multiple Indices)<\/strong><\/p>\n

Approach:<\/strong><\/p>\n