3 ms·
But this is apples and oranges. Process 1 creates and calls lambdas, etc. A proper comparison could be: # Case 1. for n in range(len(data)): data[n] =
by nine_k 2y ago
But this is apples and oranges. Process 1 creates and calls lambdas, etc.
A proper comparison could be:
# Case 1.
for n in range(len(data)):
data[n] = transform1(data[n])
data[n] = transform2(data[n])
# Case 2.
for n in range(len(data)):
data[n] = transform1(data[n])
for n in range(len(data)):
data[n] = transform2(data[n])
- thrww120956 2y agoIt illustrates how this kind of code is used in the wild - array functions vs a for loop. What you did is not even a fruit, if I go along with your metaphor.