1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
import numpy as np
import csv
tableau = [['A', 'B', 'C'],[4.0, 1.1, 1.05],[1.0, 0.6, 1.09]]
w_file=open('test.csv', 'wb')
c = csv.writer(w_file, delimiter=';')
for liste in tableau: c.writerow(liste)
x = np.ndarray (shape = (40), dtype=float)
y = np.ndarray (shape = (40), dtype=float)
z = np.ndarray (shape = (40), dtype=float)
y.fill (3.)
i = 0
while (i<40):
x[i] = 10.*i
i=i+1
print x
print y
z = x*y
print z
step = 1.
time = 0.
while (time < 100.):
print time, z[0],x[0]
tableau = [time,z[0],x[0]]
c.writerow(tableau)
time = time + step
w_file.close()
del c
del w_file |
Partager