Thu Feb 5 17:15:56 CST 2009
On Thu, Feb 5, 2009 at 17:06, Ryan May <email@example.com> wrote:
> Ok, what am I missing here:
> x = np.array([[4,2],[5,3]])
> array([[[5, 3],
> [4, 2]],
> [[5, 3],
> [4, 2]]])
> I was expecting:
> Certainly not a 3D array. What am I doing wrong?
Remember that x[i] applies the index array i to the first axis of x.
In order to apply i to the second axis, you need an argument in the
first position, too, to give the indices that apply to the first axis.
Remember that the arguments will be broadcast against each other.
In : x[ [,], x.argsort(1)]
"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