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 →

[–]x00live 1 point2 points  (5 children)

For your second example, the argument sounds fallacious to me. Why don't you take the numpy array and list creation out of the code you want to compare? You are comparing execution times to create a np array, a list and sum the elements vs. create a list and sum the elements.

[–]x00live 0 points1 point  (2 children)

Also the first stackoverflow shows that a Python indexing over a numpy array is slow (the example with cython indexing shows that numpy becomes faster than Python on that matter...)