title: Iterate and replace values through a numpy array Python
body: <p>I'm looking for creating a random dimension numpy array, iterate and replace values per 10 for example.</p>
  <p>I tried :</p>
  <pre><code># Import numpy library
  import numpy as np
  
  def Iter_Replace(x):
      print(x)
      for i in range(x):
          x[i] = 10
      print(x)
      
  
  def main():
      x = np.array(([1,2,2], [1,4,3]))
      Iter_Replace(x)
  
  main()
  </code></pre>
  <p>But I'm getting this error :</p>
  <pre><code>TypeError: only integer scalar arrays can be converted to a scalar index
  </code></pre>