From 776bef10d76ff5022176fa817e81b51a1569d8b4 Mon Sep 17 00:00:00 2001 From: Michel Date: Sun, 13 Apr 2025 05:43:00 +0200 Subject: [PATCH] =?UTF-8?q?"Injection=20donn=C3=A9es=20dans=20Tables=20Meu?= =?UTF-8?q?don=20et=20Roissy"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Inventaires.py | 9 ++++++++- Streamlit.py => domo91.py | 0 2 files changed, 8 insertions(+), 1 deletion(-) rename Streamlit.py => domo91.py (100%) diff --git a/Inventaires.py b/Inventaires.py index ba34bc5..d7a4e79 100644 --- a/Inventaires.py +++ b/Inventaires.py @@ -34,7 +34,14 @@ uploaded_file = st.file_uploader("📥 Charger le fichier Excel (.xlsx)", type=" if uploaded_file: try: - df = pd.read_excel(uploaded_file, sheet_name="Inventaire") + df = pd.read_excel(uploaded_file, sheet_name="Inventaire", usecols="C:E", header=1) + df.columns = ["Id_Article", "Prix", "Quantité"] + df = df[["Id_Article", "Quantité", "Prix"]] # Réorganisation + + # Nettoyage : retirer les lignes où Quantité est vide ou invalide + df = df.dropna(subset=["Quantité"]) + df = df[df["Quantité"].astype(str).str.strip() != ""] + df = df[pd.to_numeric(df["Quantité"], errors='coerce').notnull()] colonnes_attendues = ["Id_Article", "Quantité", "Prix"] if all(col in df.columns for col in colonnes_attendues): diff --git a/Streamlit.py b/domo91.py similarity index 100% rename from Streamlit.py rename to domo91.py