Created
March 27, 2023 21:59
-
-
Save mjam03/d706eca5134dda2276b514dd0c0ff4d4 to your computer and use it in GitHub Desktop.
what_exactly_does_'vectorisation'_mean?0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
# python list of 100m ints | |
L_py = [x for x in range(0, 100_000_000)] | |
# nd array of 100m ints | |
L_np = np.arange(0, 100_000_000) | |
# time each | |
%timeit sum(L_py) | |
%timeit np.sum(L_np) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment