Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > fr.comp.lang.python > #3017

Tracer une courbe à partir d'un fichier text

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> (permalink)
Subject Tracer une courbe à partir d'un 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

Show key headers only | View raw


Bonjour à tous,

Je suis débutant sur python. Je souhaiterai savoir comment on fait pour tracer une courbe à partir d'un fichier text

Voici les données 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 écris :

import matplotlib.pyplot as plt
import numpy as np

f = open("Values.txt" , 'r')
t = f.readlines()
t.remove(t[0])
list = []
for i in t:
    list.append(i.split())

for i in range(len(list)):
    value=list[i]
    #print(value)
    w =[]
    for i in range(len(value)):
        w = value[i]
        w = float(w)
        y = []
        y.append(w)
        print(y[:,0])


Comment fait on pour créer une liste pour x et une autre liste pour y?
et ensuite le tracer ?

Merci, 
cordialement,

Back to fr.comp.lang.python | Previous | NextNext in thread | Find similar


Thread

Tracer une courbe à partir d'un fichier text baladjy@gmail.com - 2018-01-20 06:59 -0800
  Re: Tracer une courbe à partir d'un fichier text Alain Ketterlin <alain@universite-de-strasbourg.fr.invalid> - 2018-01-20 18:12 +0100
  Re: Tracer une courbe à partir d'un fichier text baladjy@gmail.com - 2018-01-20 12:45 -0800
  Re: Tracer une courbe à partir d'un fichier text yves <yves@free.invalid> - 2018-01-21 10:35 +0000
    Re: Tracer une courbe à partir d'un fichier text yves <yves@free.invalid> - 2018-01-21 16:01 +0000
  Re: Tracer une courbe à partir d'un fichier text marc@marc.marc - 2018-01-22 13:41 +0100

csiph-web