[Numpy-discussion] design issues - octave 'incompatibilities'

Perry Greenfield perry at stsci.edu
Mon Jul 25 14:48:05 EDT 2005


I missed this part and was reminded by Travis's message.

On Jul 23, 2005, at 12:03 PM, Soeren Sonnenburg wrote:
> -- How can one obtain submatrices from full matrices:
>
> numarray gives only elements (which is very, very rarely needed and
> should IMHO rather be some extra function):
>
>>>> i=[0,1]
>>>> j=[0,2]
>>>> a[i,j]
> array([1, 6])
>
> vs octave:
>>> i=[1,2];
>>> j=[1,3];
>>> a(i,j)
> ans =
>         1        3
>         4        6
>
Maybe for you it is rarely needed, but not for us. The situation is 
reversed. The latter is rarely used in our case. This is largely a 
reflection of whether your orientation is matrices or multidimensional 
arrays. In our case it is quite handy to select out a list of point in 
an image by giving a list of their respective indices (e.g., stars).

True, I do see that others may need the other view, but then the 
question is which should get the convenience. Since Numeric/numarray 
are primarily oriented towards multidimensional arrays (e.g., 
operations are element-by-element rather than matrix) it seemed to make 
sense to go this way for consistency, but I understand that there is 
another side to this.

Perry





More information about the NumPy-Discussion mailing list