edb-noumea 0.2.9__py3-none-any.whl → 0.2.11__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
edb_noumea/details.py CHANGED
@@ -96,27 +96,17 @@ def get_detailed_results():
96
96
  print("\nColonnes:", list(df.columns))
97
97
  print("Shape:", df.shape)
98
98
 
99
- # Sélectionne et renomme les colonnes demandées
100
- columns_map = {
101
- 'Unnamed: 0': 'Nom du site de baignade',
102
- 'Unnamed: 1': 'Point de prélèvement',
103
- 'Unnamed: 2': 'Date du prélèvement',
104
- 'Unnamed: 3': 'Heure du prélèvement',
105
- 'Escherichia': 'Escherichia coli (NPP/100ml)',
106
- 'Entérocoques': 'Entérocoques intestinaux (NPP/100ml)'
107
- }
108
- cleaned_df = df[list(columns_map.keys())].rename(columns=columns_map)
109
- # Supprime la première ligne (ligne d'en-tête du PDF)
110
- cleaned_df = cleaned_df.iloc[1:].reset_index(drop=True)
111
- # Renomme les colonnes pour correspondre au style Python
112
- cleaned_df = cleaned_df.rename(columns={
113
- "Nom du site de baignade": "site",
114
- "Point de prélèvement": "point_de_prelevement",
115
- "Date du prélèvement": "date",
116
- "Heure du prélèvement": "heure",
117
- "Escherichia coli (NPP/100ml)": "e_coli_npp_100ml",
118
- "Entérocoques intestinaux (NPP/100ml)": "enterocoques_npp_100ml"
119
- })
99
+ # Sélectionne les colonnes par position et applique le mapping fixe
100
+ expected_columns = [
101
+ "site",
102
+ "point_de_prelevement",
103
+ "date",
104
+ "heure",
105
+ "e_coli_npp_100ml",
106
+ "enterocoques_npp_100ml"
107
+ ]
108
+ cleaned_df = df.iloc[:, :6].copy()
109
+ cleaned_df.columns = expected_columns
120
110
 
121
111
  # Ajoute deux colonnes issues du split de 'point_de_prelevement'
122
112
  split_points = cleaned_df["point_de_prelevement"].str.split(",", n=1, expand=True)
@@ -130,7 +120,7 @@ def get_detailed_results():
130
120
  # Nettoyer et convertir les colonnes e_coli_npp_100ml et enterocoques_npp_100ml
131
121
  for col in ["e_coli_npp_100ml", "enterocoques_npp_100ml"]:
132
122
  if col in cleaned_df.columns:
133
- cleaned_df[col] = cleaned_df[col].replace(r"<\s*10", "10", regex=True)
123
+ cleaned_df[col] = cleaned_df[col].astype(str).str.replace(r"<\s*10", "10", regex=True)
134
124
  cleaned_df[col] = pd.to_numeric(cleaned_df[col], errors="coerce").astype('Int64')
135
125
 
136
126
  return cleaned_df
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: edb-noumea
3
- Version: 0.2.9
3
+ Version: 0.2.11
4
4
  Summary: Un scraper pour la qualité des eaux de baignade à Nouméa.
5
5
  Project-URL: Homepage, https://github.com/adriens/edb-noumea
6
6
  Project-URL: Repository, https://github.com/adriens/edb-noumea
@@ -0,0 +1,7 @@
1
+ edb_noumea/__init__.py,sha256=G7WKTGLsr2wtW1E2jYpqq4miZLoSGhTifSE36CGNkLo,60
2
+ edb_noumea/details.py,sha256=qXI0Pbiw8x_qAxoKzsojD5sONuRCzEUFbNCw0gyBWjQ,5810
3
+ edb_noumea/main.py,sha256=KWT0ZGrHlbhEsQxi_Rw0Mm1syDIxoY-Px1yab94IbJc,2115
4
+ edb_noumea-0.2.11.dist-info/METADATA,sha256=VRuo1yz2bt1KoQ299pncUzUbVsAA-QLcM8WosDFgMds,396
5
+ edb_noumea-0.2.11.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
6
+ edb_noumea-0.2.11.dist-info/top_level.txt,sha256=Dj3JusM0b5H9_f9yZeO-IwucCZzI1OHSjLMKtvRjq6k,11
7
+ edb_noumea-0.2.11.dist-info/RECORD,,
@@ -1,7 +0,0 @@
1
- edb_noumea/__init__.py,sha256=G7WKTGLsr2wtW1E2jYpqq4miZLoSGhTifSE36CGNkLo,60
2
- edb_noumea/details.py,sha256=NEYBssm-WGmYaR-IPNzOzkoROXumuERXBtFt5G3KcMM,6485
3
- edb_noumea/main.py,sha256=KWT0ZGrHlbhEsQxi_Rw0Mm1syDIxoY-Px1yab94IbJc,2115
4
- edb_noumea-0.2.9.dist-info/METADATA,sha256=uJQuJ_19brGRJE0-aZpA6JBa1v1f9teBjJHc8tuy2JM,395
5
- edb_noumea-0.2.9.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
6
- edb_noumea-0.2.9.dist-info/top_level.txt,sha256=Dj3JusM0b5H9_f9yZeO-IwucCZzI1OHSjLMKtvRjq6k,11
7
- edb_noumea-0.2.9.dist-info/RECORD,,