News for hackers. Stuff that matters.
Re:Why Python uses 0-based indexing. It's because of slices by kevincrane on Wednesday October 23, 2013 @05:51PM (#6601984)
Matlab does (or at least it did when I used it for a class a few years ago). I was trying to iterate through some array for a project and kept hitting an error, and was totally stumped until some EE major came over and fixed it. "Haha did you forget how to count? You're starting the index at 0, that's the problem."
Re:Why Python uses 0-based indexing. It's because of slices by ArbitraryLimits on Wednesday October 23, 2013 @05:54PM (#6602012)
Did the same guy remind you that "i" is a poor choice for an index in Matlab because it's actually sqrt(-1)? And _then_ tell you that you're supposed to do array reshaping instead of loops in Matlab? Because if the same guy had hit me with all three I might have killed him.
Re:Why Python uses 0-based indexing. It's because of slices by ihuman on Wednesday October 23, 2013 @07:03PM (#6602374)
I had to use matlab the other day. It still starts at one. The first time I used it, that confused me too.
Re:Why Python uses 0-based indexing. It's because of slices by aidos on Wednesday October 23, 2013 @08:34PM (#6602729)
I've just started using Octave (for the coursera machine learning course) and it also starts at 1. Takes a few exercises to reaclimatise. More annoying is that it doesn't auto broadcast matrix operations like numpy does (and the slicing doesn't feel as powerful either).
Re:Why Python uses 0-based indexing. It's because of slices by Dylan16807 on Wednesday October 23, 2013 @07:02PM (#6602370)
Hahahaha respecting the matlab scripting language, good one.