title: Comparing elements of an array to a scalar and getting the max in Python
body: <p>I want to compare the elements of an array to a scalar and get an array with the maximum of the compared values. That's I want to call</p>
  
  <pre><code>import numpy as np
  np.max([1,2,3,4], 3)
  </code></pre>
  
  <p>and want to get</p>
  
  <pre><code>array([3,3,3,4])
  </code></pre>
  
  <p>But I get</p>
  
  <pre><code>ValueError: 'axis' entry is out of bounds
  </code></pre>
  
  <p>When I run </p>
  
  <pre><code>np.max([[1,2,3,4], 3])
  </code></pre>
  
  <p>I get</p>
  
  <pre><code>[1, 2, 3, 4]
  </code></pre>
  
  <p>which is one of the two elements in the list that is not the result I seek for. Is there a Numpy solution for that which is fast as the other built-in functions?</p>