Why IPython is much faster than python? -
import numpy np import time xyz = np.random.rand(3,2399,2399) t1 = time.time() = [] _ 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 code. python 3 run code in 21.24s while ipython use 12.6s. magic ipython do?
python 3.6.1
ipython 5.3.0
Comments
Post a Comment