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

Emanuel Woiski woiski@gmail....
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 <svetosch@gmx.net> 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]
> by
> from numpy.matlib import [whatever]
> you get everything there is in numpy, and things like ones() zeros()
> empty() etc. will always be 2d matrices.
>
> -sven
>
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion@scipy.org
> http://projects.scipy.org/mailman/listinfo/numpy-discussion
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20071116/b96d3164/attachment.html 


More information about the Numpy-discussion mailing list