Python NumPy put() is an inbuilt function that is used to replace specific array elements with given values. Means, if we want to replace any array element with another value we can use this function.

Python NumPy put()

NumPy put(array, indices, p_array, mode = ‘raise’) function replaces specific elements of an array with given values of p_array.

Syntax

numpy.put(array, indices, values, mode)

#python #numpy

Python NumPy put() Function Example
17.30 GEEK