[Numpy-discussion] bug in http://www.scipy.org/NumPy_for_Matlab_Users
Kevin Jacobs <email@example.com>
Sun Apr 29 15:19:55 CDT 2007
On 4/29/07, Andrew Straw <firstname.lastname@example.org> wrote:
> No, the nth index of a Python sequence is a[n], where n starts from
> zero. Thus, if I want the nth dimension of array a, I want a.shape[n].
> I reverted the page to its original form and added a couple explanatory
> comments about zero vs one based indexing.
<pedantic sounding rant -- apologies in advance>
Those among us who value correct English will continue to insist that
ordinal numbers begin with "first" and the concept of "zeroth" is an
unnatural technological bastardization. (This is not to say that zero-based
indexing is bad -- just distinct from the ordinal.)
The first index of 'a' is 0, the first element is a, the second index is
1 and the second element is a, etc. Thus, the n-th index or element, a
contraction of ordinal numbering, is correctly and canonically written as
a[n-1] in a zero-based index scheme. The linguistics of "n-th" are that of
ordinality in both English and mathematics, requiring an explicitly mapping
to the technological concept of a given indexing syntax.
Glossing over that difference, especially when it contradicts the most
natural conventions of the target audience, is unfriendly and
counterintuitive. The only reason why it makes sense to you only because of
your disadvantage of already understanding that which you are trying to
</pedantic sounding rant>
My recommendation: keep a[n-1] _and_ include a lucid discussion on
> Numpy-discussion mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Numpy-discussion