[Numpy-discussion] r_, c_, hstack, and vstack with 1-d arrays

Sven Schreiber svetosch at gmx.net
Fri Jul 21 04:00:18 CDT 2006


Bill Baxter schrieb:

> Finally, I noticed that the atleast_nd methods return arrays
> regardless of input type.  At a minimum, atleast_1d and atleast_2d on
> matrices should return matrices.  I'm not sure about atleast_3d, since
> matrices can't be 3d.  (But my opinon is that the matrix type should
> be allowed to be 3d).  Anyway, since these methods are used by the
> *stack methods, those also do not currently preserve the matrix type
> (in SVN numpy).
> 

Are you sure? I reported that issue with *stack and I remember it was fixed.


> SUMMARY:
> * make r_ behave like "vstack plus range literals"
> * make column_stack only transpose its 1d inputs.
> * rename r_,c_ to v_,h_ (or something else) to make their connection
> with vstack and hstack clearer.  Maybe vs_ and hs_ would be better?
> * make a new vertsion of 'c_' that acts like column_stack so that
> theres a nice parallel v_<=>vstack,  h_<=>hstack, c_<=>column_stack
> * make atleast_*d methods preserve the input type whenever possible
> 

One problem with all that renaming is the other (maybe more important)
function of r_: build (array or) matrix ranges quickly. So I'm a bit
against the renaming I guess. Cleaning up the irritations with the
*stacks seems useful though. (Although I have to confess I haven't read
your last mail very thoroughly.)
-Sven





More information about the Numpy-discussion mailing list