title: np.array to a function in python - 'list' object is not callable
body: <p>I'm trying to eliminate some values from the present list but not getting an idea where I'm going wrong. </p>
  
  <p>I have just started exploring Jupyter with python for data science. Any suggestions will be appreciated. </p>
  
  <p>Q Write a function that takes a NumPy array (of any shape and size), and two clipping values, call range_min and range_max. Any values in the input greater than range_max should be clipped to be equal to range_max, and any values less than range_min should be clipped to be equal to range_min.    </p>
  
  <pre class="lang-py prettyprint-override"><code>    def clip_array_range(array, range_min, range_max):
          if array[val] &lt; range_min:
              return range_min
          if array[val] &gt; range_max:
              return range_max
          return array[val] 
  
      a = np.array([-3, 2, 3, 5, 22, -12, -8, 2, 10, 38, 15])
      a_clipped = clip_array_range(a, -10, 10)
      print(a_clipped)
      # expected result: [ -3   2   3   5  10 -10  -8   2  10  10  10]     
  
      a = np.array([100, -100, 50, -50]).reshape(2,2)
      a_clipped = clip_array_range(a, -10, 10)
      print(a_clipped)
      # expected result: [[10 -10][10,-10] 2X2 array`
  </code></pre>
  
  <p>The error is                                                              </p>
  
  <pre class="lang-py prettyprint-override"><code>     a = np.array([-3, 2, 3, 5, 22, -12, -8, 2, 10, 38, 15])       
       a_clipped = clip_array_range(a, -10, 10)
       print(a_clipped)
       # TypeError -list object is not callable
  </code></pre>