def add_and_sum(x, y): added = x + y summed = added.sum(axis=1) return summed def call_function(): x = np.random.randn(1000, 1000) y = np.random.randn(1000, 1000) return add_and_sum(x, y) x = np.random.randn(3000, 3000) y = np.random.randn(3000, 3000) %lprun -f add_and_sum add_and_sum(x,y) Timer unit: 1e-06 s Total time: 0.104848 s File: <ipython-input-1-d7add890ce66> Function: add_and_sum at line 1 Line #…

© 2014 In R we trust.
Top
Follow us: