Robert Kern wrote: > Instead, if you put both arguments into ogrid: > > In [4]: ogrid[0:5, 0:6] > Out[4]: > [array([[0], > [1], > [2], > [3], > [4]]), > array([[0, 1, 2, 3, 4, 5]])] > > We get the kind of arrays you need. These shapes are compatible, > through broadcasting, and together form the indices to select out the > part of the matrix you are interested in. > > However, just using the slices on the matrix instead of passing the > slices through ogrid is faster.
So what is ogrid useful for? Just curious... -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception chris.bar...@noaa.gov _______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion