[SciPy-user] mgrid waste

Alan G Isaac aisaac at american.edu
Thu Apr 14 15:57:41 CDT 2005


Mesh grids seem overused and inefficient.
Am I overlooking an alternative?

Suppose I have lists (or other iterables) X and Y
and I want to produce the 2-D array of values
Zij=f(Xi,Yj).  Doing this with mgrid seems really
wasteful (as the data seem to be copied---right?).

Add dimensions -> more wasteful.

Is there a function that handles this in the obvious way?
E.g., Z=broadcast(f,X,Y)

Thank you,
Alan Isaac






More information about the SciPy-user mailing list