3 ms·
Negative indexing (along with the related syntax for slicing) is one of the most usefull python features. Numpy and pandas thrive on it. Just learn the languag
by jaggirs 6y ago
Negative indexing (along with the related syntax for slicing) is one of the most usefull python features. Numpy and pandas thrive on it.
Just learn the language, python is already one of the easiest languages out there.
- throwaway_pdp09 6y agoI know python. I have rarely found negative indices useful except to pick out the last item of a list, and I've done a decent amount of it, though no numpy/pandas yet. In what way is negative indices particularly useful for these latter two? I have no problem with slicing. You can't get it accidentally wrong because the syntax is visible. Negative indexing vs positive indexing can't generally be distinguished just by looking at the indexing statement, which is where I tripped up.