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

Robin robince@gmail....
Mon Oct 8 17:00:39 CDT 2007


Hi,

I am trying to implement a project in scipy. I think I am getting somewhere
finally.

However in my code (I am converting from MATLAB) it is important to maintain
2d arrays, and keep the difference between row and column vectors. After
working through some initial problems I think I am getting more of a picture
of how things work in numpy.

However I am finding my code littered with things like:
np.array(np.r_[0:nterms],ndmin=2)    (for a row vector)
or
np.array(np.r_[0:nterms],ndmin=2).T (for a column vector)

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?

Thanks,

Robin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20071008/af097fa5/attachment.html 


More information about the Numpy-discussion mailing list