Skip to content

Instantly share code, notes, and snippets.

@johntyree
Created January 7, 2014 16:25
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 johntyree/8301919 to your computer and use it in GitHub Desktop.
Save johntyree/8301919 to your computer and use it in GitHub Desktop.
Memory profile of numpy array access
# GistID: 8301919
import numpy as np
import gc
from memory_profiler import profile
n = 30
m = 1000000
@profile
def main():
foo = np.zeros((n, m))
foo.sum()
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment