You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
import datetime
|
|
|
|
|
|
|
|
def numeroJour(date):
|
|
|
|
"""renvoie un entier correspondant au numéro du jour correspondant (entre 1 et 365)"""
|
|
|
|
day = datetime.datetime.strptime(date, "%Y-%m-%d")
|
|
|
|
num_day = day.strftime('%j')
|
|
|
|
return num_day
|
|
|
|
|
|
|
|
def lecture(name):
|
|
|
|
"""lit le fichier csv dont le nom est passé en paramètre, en renvoie trois tableau contenant
|
|
|
|
respectivement la longueur et la largeur des pétales, et l'espèce de l'iris."""
|
|
|
|
lst_return = []
|
|
|
|
with open(name) as fic:
|
|
|
|
fic.readline()
|
|
|
|
for ligne in fic:
|
|
|
|
date, pic, temp_moy, temp_ref = ligne.split(';')
|
|
|
|
tuple_date = (numeroJour(date) ,float(temp_moy), float(temp_ref))
|
|
|
|
lst_return.append([float(pic), tuple_date])
|
|
|
|
|
|
|
|
return lst_return
|
|
|
|
|
|
|
|
print(lecture("jeuTests.csv"))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|