[Numpy-discussion] A matrix user in the land of arrays
Fri May 9 13:43:34 CDT 2008
On Fri, May 9, 2008 at 1:41 PM, Keith Goodman <firstname.lastname@example.org> wrote:
> That looks good. But at the end of the function I'll have to convert
> back to a 1d array if the input is 1d
> I guess there is no way to not test for the shape.
Well, in this case, since you are modifying the data in-place, just
return the original array.
x2 = atleast_2d(x)
x2[i,j] = something
"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