Spaces:
Runtime error
Runtime error
Commit
·
79104c9
1
Parent(s):
f8cfe0e
Pytorch V0.10
Browse files
app.py
CHANGED
|
@@ -13,8 +13,7 @@ def get_data():
|
|
| 13 |
cleaned_data = []
|
| 14 |
for record in records:
|
| 15 |
fields = record.get("fields", {})
|
| 16 |
-
#
|
| 17 |
-
if all(key in fields for key in ['nom_courant_denomination', 'commune', 'libelle_section_naf', 'tranche_effectif_entreprise', 'action_rse']):
|
| 18 |
cleaned_data.append(fields)
|
| 19 |
return cleaned_data
|
| 20 |
else:
|
|
@@ -24,6 +23,10 @@ def display_organisations_engagees(data):
|
|
| 24 |
st.markdown("## OPEN DATA RSE")
|
| 25 |
st.markdown("### Découvrez les organisations engagées RSE de la métropole de Bordeaux")
|
| 26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
if data:
|
| 28 |
df = pd.DataFrame(data)
|
| 29 |
df = df[['nom_courant_denomination', 'commune', 'libelle_section_naf', 'tranche_effectif_entreprise', 'action_rse']]
|
|
|
|
| 13 |
cleaned_data = []
|
| 14 |
for record in records:
|
| 15 |
fields = record.get("fields", {})
|
| 16 |
+
if fields: # Assurer que le champ n'est pas vide
|
|
|
|
| 17 |
cleaned_data.append(fields)
|
| 18 |
return cleaned_data
|
| 19 |
else:
|
|
|
|
| 23 |
st.markdown("## OPEN DATA RSE")
|
| 24 |
st.markdown("### Découvrez les organisations engagées RSE de la métropole de Bordeaux")
|
| 25 |
|
| 26 |
+
# Compter le nombre d'établissements et afficher le nombre
|
| 27 |
+
num_etablissements = len(data)
|
| 28 |
+
st.markdown(f"Nombre d'établissements : {num_etablissements}")
|
| 29 |
+
|
| 30 |
if data:
|
| 31 |
df = pd.DataFrame(data)
|
| 32 |
df = df[['nom_courant_denomination', 'commune', 'libelle_section_naf', 'tranche_effectif_entreprise', 'action_rse']]
|