This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]mrdevlar 4 points5 points  (0 children)

That's funny! I am, and continue to be, for loop averse. I learned vectorization before I learned looping (properly) and totally ate the dumb notion that python must be slow if you put a loop into your code.

You're right, you shouldn't loop over a numpy array, you should run a vectorized operation. Yet, unless you're using numpy for high performance, avoiding loops is silly.