Is it possible to apply a numpy function based on a string ? If I give 'max' call np.max.
values = np.array([[1,2,-1],[2,3,6], [0,-1,4]])
aggregator = 'max'
print np.max(values, axis=0)
>>> [2 3 6]
What I hope is something like this :
some_cool_function(aggregator, values, axis=0)
>>> [2 3 6]
This will give a better readability and shorten my code. Instead of doing multiple if.
EDIT :
I found the numpy.apply_along_axis but it expects a function, it can't be a string.