[Numpy-discussion] beginner question: rank-1 arrays
Fri Nov 16 13:55:57 CST 2007
Sorry for coming very late to the thread, but you mean something like:
for i in range(len(cols):
On Oct 9, 2007 4:36 AM, Sven Schreiber <email@example.com> wrote:
> Alan G Isaac schrieb:
> > On Mon, 8 Oct 2007, Robin apparently wrote:
> >> 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.
> > How about using matrices?
> > help(numpy.mat)
> > hth,
> > Alan Isaac
> Robin, Alan is right, you want numpy matrices which are always 2d. Check
> out numpy.matlib; if you replace
> from numpy import [whatever]
> from numpy.matlib import [whatever]
> you get everything there is in numpy, and things like ones() zeros()
> empty() etc. will always be 2d matrices.
> Numpy-discussion mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Numpy-discussion