Python for Finance: Analyze Big Financial Data

(Elle) #1

In [ 81 ]: for i in range( 1 , 20 ):
np.random.seed( 1000 )
x = np.random.random(i 10 ) (b - a) + a
print np.sum(f(x)) / len(x) * (b - a)


Out[81]: 24.8047622793
26.5229188983
26.2655475192
26.0277033994
24.9995418144
23.8818101416
23.5279122748
23.507857659
23.6723674607
23.6794104161
24.4244017079
24.2390053468
24.115396925
24.4241919876
23.9249330805
24.1948421203
24.1173483782
24.1006909297
23.7690510985

Free download pdf