source:
sasmodels/Testers/test.py
@
ff7119b
Last change on this file since ff7119b was a42fec0, checked in by HMP1 <helen.park@…>, 10 years ago | |
---|---|
|
|
File size: 168 bytes |
Rev | Line | |
---|---|---|
[a42fec0] | 1 | impor |
2 | ||
3 | ||
4 | ||
5 | ||
[099e053] | 6 | import numpy as np |
7 | ||
8 | ||
9 | x = np.array([0, 1, 2, 3]) | |
10 | y = 2*x + 1 | |
11 | ||
12 | print y | |
13 | sum = 0 | |
14 | ||
15 | for i in xrange(x.size-1): | |
16 | sum += (x[i+1]-x[i])*(y[i]+y[i+1])/2 | |
17 | ||
18 | print sum | |
[a42fec0] | 19 |
Note: See TracBrowser
for help on using the repository browser.