Am 03.11.2016 um 00:49 schrieb Allin Cottrell:
On Wed, 2 Nov 2016, Sven Schreiber wrote:
>
> First, it would be an improvement. Second, if at all possible, I would
> favor some clever extension of the matrix indexing apparatus. For
> example (just an example, no claim of optimality), X[-3, -2] might
> return the matrix X without the 3rd row and the 2nd column.
I appreciate that you said "no claim of optimality", but I don't think
we should use negative indices for the purpose you indicate. Seems to me
the de facto standard regarding negative indices in matrix-oriented
languages is that they mean, "count from the end, not the beginning",
not "drop these rows or columns".
That's true. See how I didn't let my Python/numpy bias show while making
this suggestion?
So any other symbol that is not an arithmetic operator might also do
perhaps. Given that "!" is already negation in the context of "!=",
maybe X[!3, !2] ? Or ยง?
BTW, "while we're on the subject", a short form for defining a
range/sequence matrix would also be nice. Something like:
{1:5} == seq(1,5)
Then you could do X[!{1:5}, ] which would mean drop the first five rows
from X.
thanks,
sven