title: Python Apply Function to All Elements of Array Less Than 0
body: <p>I want to apply a function to all the elements of my matrix which are less than or equal to 0 which takes as an argument that element. </p>
  
  <pre><code>   my_matrix[my_matrix &lt;= 0] = 3 * (func(my_input_here))
  </code></pre>
  
  <p>So for example, if we have </p>
  
  <pre><code>[0 3 5
  -3 5 3
   9 2 -1]
  </code></pre>
  
  <p>I want to replace <code>-3</code> with <code>3 * func(-3)</code> and <code>-1</code> with <code>3 * func(-1)</code></p>