On 8/30/06, Sven Schreiber <[EMAIL PROTECTED]> wrote:
> Mathew Yeates schrieb:
> will be a numpy matrix, use <asarray> if you don't like that. But here
> it's really nice to work with matrices, because otherwise .sum() will
> give you a 1-d array sometimes, and that will suddenly look like a row
> to <hstack> (instead of a nice column vector) and wouldn't work --
> that's why matrices are so great and everybody should be using them ;-)
column_stack would work perfectly in place of hstack there if it only
didn't have the silly behavior of transposing arguments that already
are 2-d.
For reminders, here's the replacement implementation of column_stack I
proposed on July 21:
def column_stack(tup):
def transpose_1d(array):
if array.ndim<2: return _nx.transpose(atleast_2d(array))
else: return array
arrays = map(transpose_1d,map(atleast_1d,tup))
return _nx.concatenate(arrays,1)
This was in a big ticket I submitted about overhauling r_,c_,etc,
which was largely ignored. Maybe I should resubmit this by itself...
--bb
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Numpy-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/numpy-discussion