[Numpy-discussion] Understanding mgrid
Fri Sep 19 14:20:06 CDT 2008
On Fri, Sep 19, 2008 at 14:13, Brad Malone <email@example.com> wrote:
> Thanks for the response Robert.
> So, at least in this case, the results of mgrid (or indices) only provides
> information about the spacing of the grid and not on the absolute value of
> the point coordinates?
No, they give indices. You can use those indices in a variety of ways.
In my example, I used them to index into vectors which gave the
absolute positions of the grid lines. That turned into bricks giving
the absolute coordinates for each 3D grid point.
> In your example, is there a way to see within your x[ix], y[iy], and z[iz]
> matrices the same collection of points that you would see if you did
> something like the following?
> for k in z.tolist():
> for j in y.tolist():
> for i in x.tolist():
points = column_stack([x[ix].flat, y[iy].flat, z[iz].flat])
"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
-- Umberto Eco
More information about the Numpy-discussion