0
import numpy as np
import time

xyz = np.random.rand(3,2399,2399)
t1 = time.time()
a = []
for _ in range(10):
    a.append((xyz/np.linalg.norm(xyz, axis=0)-np.array([0,0,1])[:,np.newaxis,np.newaxis])/3)
t2 = time.time()
print(t2-t1)

This is my code. Python 3 run this code in 21.24s while IPython just use 12.6s. What magic does IPython do?

Python 3.6.1

IPython 5.3.0

Shen Zhou
  • 11
  • 1
  • 2

0 Answers0