Skip to content

Commit

Permalink
load csv
Browse files Browse the repository at this point in the history
  • Loading branch information
davy39 committed Feb 28, 2024
1 parent 9a3e8f4 commit 160f4cf
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from js import fetch

reponse = await fetch(f"../{url_fichier}")
reponse = await fetch(f"{url_fichier}")
contenu = await reponse.text()

with open(file=url_fichier, mode="w", encoding=encodage) as fichier:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from js import fetch

reponse = await fetch(f"../{url_fichier}")
reponse = await fetch(f"{url_fichier}")
contenu = await reponse.text()

with open(file=url_fichier, mode="w", encoding=encodage) as fichier:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from js import fetch

reponse = await fetch(f"../{url_fichier}")
reponse = await fetch(f"{url_fichier}")
contenu = await reponse.text()

with open(file=url_fichier, mode="w", encoding=encodage) as fichier:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from js import fetch

reponse = await fetch(f"../{url_fichier}")
reponse = await fetch(f"{url_fichier}")
contenu = await reponse.text()

with open(file=url_fichier, mode="w", encoding=encodage) as fichier:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from js import fetch

reponse = await fetch(f"../{url_fichier}")
reponse = await fetch(f"{url_fichier}")
contenu = await reponse.text()

with open(file=url_fichier, mode="w", encoding=encodage) as fichier:
Expand Down Expand Up @@ -33,5 +33,3 @@ def moyenne(donnees, descripteur):
"""Renvoie la moyenne des valeurs de ce descripteur"""
pass


assert abs(moyenne(films, "Minutes") - 122.57) < 10**-2, "Erreur sur la moyenne de 'Minutes'"
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from js import fetch

reponse = await fetch(f"../{url_fichier}")
reponse = await fetch(f"{url_fichier}")
contenu = await reponse.text()

with open(file=url_fichier, mode="w", encoding=encodage) as fichier:
Expand All @@ -27,8 +27,3 @@
def projection(donnees, descripteur):
"""Renvoie la liste des valeurs de ce descripteur"""
pass


assert projection(films, "Ranking")[4] == 5, "Erreur sur la projection de 'Ranking'"
assert projection(films, "Name")[4] == "Pulp Fiction", "Erreur sur la projection de 'Name'"
assert projection(films, "Year")[4] == 1994, "Erreur sur la projection de 'Year'"
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from js import fetch

reponse = await fetch(f"../{url_fichier}")
reponse = await fetch(f"{url_fichier}")
contenu = await reponse.text()

with open(file=url_fichier, mode="w", encoding=encodage) as fichier:
Expand All @@ -28,5 +28,3 @@ def projection_multiple(donnees, descripteurs):
"""Renvoie les valeurs de ces descripteurs"""
pass


assert projection_multiple(films, ("Name", "Year", "Rating"))[0] == ("Citizen Kane", 1941, 8.3), "Erreur"
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from js import fetch

reponse = await fetch(f"../{url_fichier}")
reponse = await fetch(f"{url_fichier}")
contenu = await reponse.text()

with open(file=url_fichier, mode="w", encoding=encodage) as fichier:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from js import fetch

reponse = await fetch(f"../{url_fichier}")
reponse = await fetch(f"{url_fichier}")
contenu = await reponse.text()

with open(file=url_fichier, mode="w", encoding=encodage) as fichier:
Expand All @@ -27,6 +27,3 @@
def somme(donnees, descripteur):
"""Renvoie la somme des valeurs de ce descripteur"""
pass


assert abs(somme(films, "Gross") - 33072.07) < 10**-6, "Erreur sur la somme de 'Gross'"

0 comments on commit 160f4cf

Please sign in to comment.