9 Oct
2007
9 Oct
'07
6:36 a.m.
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