Dec 2, 2024
Sorry to nitpick, but numpy doesn't really end in the same loop, afaik. It vectorises each operation, and in your example it would most likely perform the %2, the ==0, and the **2 in three separate loops, each written in C.
Sorry to nitpick, but numpy doesn't really end in the same loop, afaik. It vectorises each operation, and in your example it would most likely perform the %2, the ==0, and the **2 in three separate loops, each written in C.
Software developer and maths enthusiast. graphicmaths.com