In [14]:
from IPython.display import Image
In [15]:
Image('pang_prof.png', width=1000)
Out[15]:
In [16]:
Image('mi_prof.png', width=400)
Out[16]:
In [20]:
import numpy as np
a = np.random.rand(10**7)
b = np.random.rand(10**7)
c = np.zeros(10**7)
def example1():
c=a+b
def example2():
for i in xrange(len(a)):
c[i] = a[i] + b[i]
def example3():
tmp = 0
for i in xrange(len(a)):
tmp += 1
In [21]:
%timeit -r 1 example1()
In [22]:
%timeit -r 1 example2()
In [23]:
%timeit -r 1 example3()
In [37]:
from math import pi
x = (pi + 10**17) - 10**17
print np.cos(x)
print np.cos(pi)
In [33]:
from math import pi
rad = 2 * pi
x = (rad / pi) * 180 * 60
y = (rad * 180 * 60) / pi
print np.cos(x)
print np.cos(y)