Les Allergies
Alimentaires
Posez votre question Signaler

Python affichage courbe message d'erreur [Résolu]

sel3 2Messages postés 2 juillet 2009Date d'inscription - Dernière réponse le 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??
Lire la suite 

Python affichage courbe message d'erreur »

1 réponses
Réponse
+0
moins plus
au fait, j'ai trouve le probleme assez vite
le dernier element de mon tableau n'etait pas correcte.
Ajouter un commentaire
Ce document intitulé « Python affichage courbe message d'erreur » issu de CommentCaMarche (www.commentcamarche.net) est mis à disposition sous les termes de la licence Creative Commons. Vous pouvez copier, modifier des copies de cette page, dans les conditions fixées par la licence, tant que cette note apparaît clairement.
Dossier à la une
Passage au tout numérique : quel coût pour les particuliers ?