Python affichage courbe message d'erreur

Résolu/Fermé
sel3 Messages postés 2 Date d'inscription jeudi 2 juillet 2009 Statut Membre Dernière intervention 10 juillet 2009 - 2 juil. 2009 à 13:16
sel3 Messages postés 2 Date d'inscription jeudi 2 juillet 2009 Statut Membre Dernière intervention 10 juillet 2009 - 10 juil. 2009 à 10:09
Bonjour,
je programme en python

je recupere le tableau periode et je souhaite affiche la courbe correspondante:
periode=[]
j=0
for j in range(z):
periode.append([])
p=0
m=0
for m in range(z-1):
periode[m]=tabkfloat[m+1] - tabkfloat[m]
print periode[m]

subplot(211)
plot(periode)
show()

periode s'affiche comme ca:
11
11
10
12
17
19
17
12
10
10
10
10
13
18
19
15
12
10
10
10
10
14
19
19



j'obtiens l'erreur suivante:
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Python25\lib\lib-tk\Tkinter.py", line 1403, in __call__
return self.func(*args)
File "N:\transfert\wireless M-Bus\python\fetc-pec7.py", line 103, in fftcourbe
plot(periode)
File "C:\Python25\lib\site-packages\matplotlib\pyplot.py", line 1780, in plot
ret = gca().plot(*args, **kwargs)
File "C:\Python25\lib\site-packages\matplotlib\axes.py", line 2654, in plot
for line in self._get_lines(*args, **kwargs):
File "C:\Python25\lib\site-packages\matplotlib\axes.py", line 392, in _grab_next_args
for seg in self._plot_1_arg(remaining[0], **kwargs):
File "C:\Python25\lib\site-packages\matplotlib\axes.py", line 260, in _plot_1_arg
x, y, multicol = self._xy_from_y(y)
File "C:\Python25\lib\site-packages\matplotlib\axes.py", line 220, in _xy_from_y
y = ma.asarray(y)
File "C:\Python25\lib\site-packages\numpy\core\ma.py", line 2123, in asarray
return array(data, dtype=dtype, copy=0)
File "C:\Python25\lib\site-packages\numpy\core\ma.py", line 567, in __init__
c = numeric.array(data, dtype=tc, copy=True, order=order)
ValueError: setting an array element with a sequence.

que dois je faire pour pouvoir afficher ma courbe??
A voir également:

1 réponse

sel3 Messages postés 2 Date d'inscription jeudi 2 juillet 2009 Statut Membre Dernière intervention 10 juillet 2009
10 juil. 2009 à 10:09
au fait, j'ai trouve le probleme assez vite
le dernier element de mon tableau n'etait pas correcte.
0