[SciPy-user] the meaning of c_ and r_

Travis Oliphant oliphant at ee.byu.edu
Fri Oct 22 17:42:01 CDT 2004

Alan G Isaac wrote:

>On Fri, 22 Oct 2004, Travis Oliphant apparently wrote:
>>The idea of r_  was to allow fast creation of arrays similar to what is
>>available with MATLAB.  I wanted a short, quick way to concatenate and
>>generate arrays.  For 1-d arrays, r_ and c_ are supposed to be exactly
>>the same.  It's only when you give them two dimensional arrays that they
>>differ.  Admittedly, I really like the one-dimensional array creation
>>ability of r_  and I use it quite often.  The two-dimensional array
>>creation is not as good.  bmat is intended to improve that some.    I am
>>open to any ideas about how to improve this.  Perhaps, we just kill c_
>>and suggest something else (like an improved bmat) for building 2-d
>>arrays quickly.
>I find both r_ and c_ nice to have around.
>I would request a single change:
>that for 1-d arrays,
>one of them return transpose([x]) instead of x.
>(In my view, r_ should do this, but whatever.)
This would be decidedly different behavior, because 1-d arrays are not 
2-d arrays.  I would be inclined to introduce another command to rapidly 
build 2-d row an/or column vectors as you describe instead of changing 
the 1-d array-creation facility of r_


More information about the SciPy-user mailing list