![](https://secure.gravatar.com/avatar/ec91d42d7e0f591d345ce91b4a3e259d.jpg?s=120&d=mm&r=g)
Hi, This is a really quick and stupid question. Let's say I have a function and I want to calculate its value for a set of points. What's the best way of quickly doing this avoiding loops? def MyFunction ( p1, p2, p3, t, y) return *some_value* t = numpy.array ( ..... ) y = numpy.array ( ....) a1,a2,a3 = numpy.mgrid [ 0:100, 0:1:100j, 0:100 ] evaluated_function = MyFunction (a1, a2, a3, t, y) evaluated_function.shape would be (100,100,100), and evaluated_function [m, n, k] should be equal to MyFunction ( a1[m], a2[n], a3[k], t, y ) I think mgrid (ogrid) are the right tools, but I don't really understand how I can get it to do what I want. I have read < http://docs.scipy.org/doc/scipy/reference/tutorial/basic.html#id5>, but that doesn't clear things up. I guess that what I want to do is just mentioned at the end of this Section of the tutorial, but can anyone maybe give an example? many thanks! J