[Numpy-discussion] Matlab page on scipy wiki

Gary Ruben gruben at bigpond.net.au
Fri Feb 10 17:30:05 CST 2006

Sasha wrote:
> On 2/10/06, Travis Oliphant <oliphant at ee.byu.edu> wrote:
>> The whole point of r_ is to allow you to use slice notation to build
>> ranges easily.  I wrote it precisely to make it easier to construct
>> arrays in a simliar style that Matlab allows.
> Maybe it is just me, but r_ is rather unintuitive.  I would expect
> something like this to be called "c" for "combine" or "concatenate."  
> This is the name used by S+ and R.

I agree that c or c_ (don't care which) is more intuitive but I can 
understand why it's ended up as it has. Even v or v_ for 'vector' or a 
or a_ for 'array' would also make sense to me. I must say that Travis's 
example numpy.r_[1,0,1:5,0,1] highlights my pet hate with python - that 
the upper limit on an integer range is non-inclusive. I'm sure the BDFL 
has some excuse for this silliness.

Gary R

More information about the Numpy-discussion mailing list