Apply numpy function based on string
<p>Is it possible to apply a numpy function based on a string ?
If I give 'max' call np.max.</p>

<pre><code>values = np.array([[1,2,-1],[2,3,6], [0,-1,4]]) 
aggregator = 'max'
print np.max(values, axis=0)
&gt;&gt;&gt; [2 3 6]
</code></pre>

<p>What I hope is something like this :</p>

<pre><code>some_cool_function(aggregator, values, axis=0)
&gt;&gt;&gt; [2 3 6]
</code></pre>

<p>This will give a better readability and shorten my code. Instead of doing multiple if. </p>

<p><strong>EDIT</strong> :</p>

<p>I found the <a href="http://docs.scipy.org/doc/numpy-1.10.0/reference/generated/numpy.apply_along_axis.html" rel="nofollow">numpy.apply_along_axis</a> but it expects a function, it can't be a string.</p>