Skip to content

Instantly share code, notes, and snippets.

@athiakos
Created January 7, 2014 15:52
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 athiakos/8301383 to your computer and use it in GitHub Desktop.
Save athiakos/8301383 to your computer and use it in GitHub Desktop.
import numpy as np
n = 30
m = 100000
# using memory_profiler package
@profile
def main():
foo = np.zeros((n,m))
boo = np.random.random(m)
blah = np.random.random(n)
for index, whatever in enumerate(blah):
foo[index,:] += boo
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment