Skip to content

Instantly share code, notes, and snippets.

@mjam03
Created March 27, 2023 21:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mjam03/d706eca5134dda2276b514dd0c0ff4d4 to your computer and use it in GitHub Desktop.
Save mjam03/d706eca5134dda2276b514dd0c0ff4d4 to your computer and use it in GitHub Desktop.
what_exactly_does_'vectorisation'_mean?0
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