Skip to content

Commit 423f3a8

Browse files
committed
2.9
1 parent 5b5b873 commit 423f3a8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

numpy/integration/riemann-sum.py

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import numpy as np
2+
3+
dxi = 0.1
4+
xi = np.arange(0, np.pi / 2, dxi)
5+
xprimei = (xi[1:] + xi[:-1])/2
6+
integral = np.sum(np.sin(xprimei) * dxi)
7+
print(integral)

0 commit comments

Comments
 (0)