[Numpy-discussion] beginner question: rank-1 arrays

Gael Varoquaux gael.varoquaux@normalesup....
Mon Oct 8 17:07:09 CDT 2007


On Mon, Oct 08, 2007 at 11:00:39PM +0100, Robin wrote:
>    Coming from matlab and being use to 0:10 for row or (0:10)' for column
>    this seems a bit messy. Is there a better way of constructing row/column
>    2d arrays from a slice type range?

r_[0:10] and c_[0:10].

Does that suit you ? The first one is indeed only 1D, but I don't see the
problem with that. If you really want 2D you can use c_[0:10].T .

Gaël


More information about the Numpy-discussion mailing list