thouis / numpy-trac-migration

numpy Trac to github issues migration
2 stars 3 forks source link

A few potential errors in the indexing documentation (Trac #2162) #5954

Open numpy-gitbot opened 11 years ago

numpy-gitbot commented 11 years ago

Original ticket http://projects.scipy.org/numpy/ticket/2162 on 2012-06-15 by atmention:lebigot, assigned to unknown.

The documentation on array indexing (http://docs.scipy.org/doc/numpy-1.6.0/reference/arrays.indexing.html#) contains a few details that look strange to me, that I list here in their order of appearance in the text:

1 - "In order to remain backward compatible with a common usage in Numeric, basic slicing is also initiated if the selection object is any sequence (such as a list) containing (…)". Wouldn't it be more correct to write "any non-ndarray sequence (such as a list)…"?

2 - About negative indexes: "if i < 0, it means n_i+i": I guess the correct value is "d_i+i" (d_i is the size of the i-th dimension, in this part of the text).

3 - About the first slice number i: "Then, if i is not given it defaults to 0 for k > 0 and n for k < 0 ." I guess the correct value is n-1 (= last element), for k<0, no?