title: Replacing values greater than a limit in a numpy array
body: <p>I have an array n x m, and maximum values for each column. What's the best way to replace values greater than the maximum, besides checking each element?</p>
  
  <p>For example:</p>
  
  <pre><code>def check_limits(bad_array, maxs):
      good_array = np.copy(bad_array)
      for i_line in xrange(bad_array.shape[0]):
          for i_column in xrange(bad_array.shape[1]):
              if good_array[i_line][i_column] &gt;= maxs[i_column]:
                  good_array[i_line][i_column] = maxs[i_column] - 1
      return good_array
  </code></pre>
  
  <p>Anyway to do this faster and in a more concise way?</p>