X-Received: by 10.237.59.91 with SMTP id q27mr1305569qte.21.1516460391719; Sat, 20 Jan 2018 06:59:51 -0800 (PST) X-Received: by 10.31.54.205 with SMTP id d196mr205216vka.14.1516460391133; Sat, 20 Jan 2018 06:59:51 -0800 (PST) Path: csiph.com!xmission!news.snarked.org!border2.nntp.dca1.giganews.com!nntp.giganews.com!i22no5335962qta.1!news-out.google.com!e39ni2035qtk.1!nntp.google.com!s47no2324157qta.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: fr.comp.lang.python Date: Sat, 20 Jan 2018 06:59:50 -0800 (PST) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=217.108.170.8; posting-account=Z5_BpAoAAAALdkvERkH2fcGnR4GK5hli NNTP-Posting-Host: 217.108.170.8 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <2f5f9fc0-2db0-49f2-830c-b86bda4dd63c@googlegroups.com> Subject: =?UTF-8?Q?Tracer_une_courbe_=C3=A0_partir_d=27un_fichier_text?= From: baladjy@gmail.com Injection-Date: Sat, 20 Jan 2018 14:59:51 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Lines: 49 Xref: csiph.com fr.comp.lang.python:3017 Bonjour =C3=A0 tous, Je suis d=C3=A9butant sur python. Je souhaiterai savoir comment on fait pou= r tracer une courbe =C3=A0 partir d'un fichier text Voici les donn=C3=A9es dans le fichier text : X Y 0 47047.969 1 46959.758 2 46855.414 3 46701.742 4 46354.426 5 44898.340 6 36412.832 7 18628.641 8 7671.260 9 5338.369 10 4831.740 voici le code que j'ai =C3=A9cris : import matplotlib.pyplot as plt import numpy as np f =3D open("Values.txt" , 'r') t =3D f.readlines() t.remove(t[0]) list =3D [] for i in t: list.append(i.split()) for i in range(len(list)): value=3Dlist[i] #print(value) w =3D[] for i in range(len(value)): w =3D value[i] w =3D float(w) y =3D [] y.append(w) print(y[:,0]) Comment fait on pour cr=C3=A9er une liste pour x et une autre liste pour y? et ensuite le tracer ? Merci,=20 cordialement,