mirror of
https://github.com/guezoloic/millesima_projetS6.git
synced 2026-03-28 19:13:42 +00:00
26 lines
684 B
Python
Executable File
26 lines
684 B
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
from os import getcwd
|
|
from os.path import normpath, join
|
|
from sys import argv
|
|
from pandas import read_csv, DataFrame
|
|
|
|
def main() -> None:
|
|
if len(argv) != 2:
|
|
raise ValueError(f"{argv[0]} <filename.csv>")
|
|
|
|
path: str = normpath(join(getcwd(), argv[1]))
|
|
db: DataFrame = read_csv(path)
|
|
print(db.all())
|
|
print(db.info())
|
|
print("\nnombre de valeurs manquantes pour chaque colonne :")
|
|
print(db.isna().sum())
|
|
db = db.dropna(subset=["Appellation"])
|
|
db.to_csv("donnee_clean.csv", index=False)
|
|
print(db.isna().sum())
|
|
|
|
if __name__ == "__main__":
|
|
try:
|
|
main()
|
|
except Exception as e:
|
|
print(f"ERREUR: {e}") |