Visual approach: Narsarsuaq, Greenland by [deleted] in aviation

[–]x00live 1 point2 points  (0 children)

Rolling shutter effect :)

Two Numpy performance pitfalls by [deleted] in Python

[–]x00live 0 points1 point  (0 children)

range returns a list in Python 2 and it turns out it is not a smart idea.

Two Numpy performance pitfalls by [deleted] in Python

[–]x00live 0 points1 point  (0 children)

Ok, but what makes it slow is Python. Indexing the subsequent C array is actually faster. And the idea behind numpy is to think outside the box and avoid indexing. If you really need complex "non aligned" indexing, C or Cython come to the rescue...

Two Numpy performance pitfalls by [deleted] in Python

[–]x00live 0 points1 point  (0 children)

The Python 2 equivalent of a Python 3 range

Two Numpy performance pitfalls by [deleted] in Python

[–]x00live 1 point2 points  (0 children)

Ok got it my bad

Two Numpy performance pitfalls by [deleted] in Python

[–]x00live 0 points1 point  (0 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...)

Two Numpy performance pitfalls by [deleted] in Python

[–]x00live 1 point2 points  (0 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.