2 ms·
This article would be more convincing if the NumPy version were actually vectorized. Replace the for-loop with result = (arr - min_val) / (max_val - min_va
by mattkrause 4y ago
This article would be more convincing if the NumPy version were actually vectorized. Replace the for-loop with
result = (arr - min_val) / (max_val - min_val)
That should often run faster and removes the allocation and for-loop, so it's easier to read.
- itamarst 4y agoYeah this was a copy/paste mistake, I have fixed it.