|
|
|
|
|
by lordgrenville
2156 days ago
|
|
It isn't just notation, though. It's a different way of operating. For example, the following adaptation of your code: c = 0
for i in range(u.size):
if u[i] < u[i + 1]:
c = c + u[i] * v[i]
else:
c = 0
cannot be vectorised (ignoring the off-by-one error for simplicity's sake).Saying that the Python interpreter should reinterpret the iterative code as if it were vectorised isn't increasing the expressivity, it's reducing it, by overriding the user's intentions. |
|