Spaces:
Running
Running
LaurentTRIPIED
commited on
Commit
•
900731b
1
Parent(s):
f5254fa
V2-Liste_MAP_Stat_19
Browse files- statistiques.py +4 -6
statistiques.py
CHANGED
@@ -9,25 +9,23 @@ import matplotlib.pyplot as plt
|
|
9 |
def display_companies_by_sector(df):
|
10 |
sector_counts = df['libelle_section_naf'].value_counts().reset_index()
|
11 |
sector_counts.columns = ['Secteur', 'Nombre']
|
12 |
-
fig = px.bar(sector_counts, x='Secteur', y='Nombre',
|
13 |
color='Nombre', labels={'Nombre':'Nombre d\'entreprises'}, template='plotly_white')
|
14 |
-
fig.update_layout(xaxis_tickangle=-45
|
15 |
st.plotly_chart(fig)
|
16 |
|
17 |
def display_company_sizes(df):
|
18 |
-
fig = px.histogram(df, x='tranche_effectif_entreprise',
|
19 |
labels={'tranche_effectif_entreprise':'Taille de l\'entreprise'}, template='plotly_white')
|
20 |
fig.update_traces(marker_color='green')
|
21 |
-
fig.update_layout(title_text="Distribution des tailles d'entreprises", title_x=0.5)
|
22 |
st.plotly_chart(fig)
|
23 |
|
24 |
def display_companies_by_commune(df):
|
25 |
commune_counts = df['commune'].value_counts(normalize=True).reset_index()
|
26 |
commune_counts.columns = ['Commune', 'Pourcentage']
|
27 |
-
fig = px.pie(commune_counts, values='Pourcentage', names='Commune',
|
28 |
template='plotly_white', hole=.3)
|
29 |
fig.update_traces(textinfo='percent+label')
|
30 |
-
fig.update_layout(title_text="Pourcentage d'entreprises par Commune", title_x=0.5)
|
31 |
st.plotly_chart(fig)
|
32 |
|
33 |
def display_rse_actions_wordcloud(df):
|
|
|
9 |
def display_companies_by_sector(df):
|
10 |
sector_counts = df['libelle_section_naf'].value_counts().reset_index()
|
11 |
sector_counts.columns = ['Secteur', 'Nombre']
|
12 |
+
fig = px.bar(sector_counts, x='Secteur', y='Nombre',
|
13 |
color='Nombre', labels={'Nombre':'Nombre d\'entreprises'}, template='plotly_white')
|
14 |
+
fig.update_layout(xaxis_tickangle=-45)
|
15 |
st.plotly_chart(fig)
|
16 |
|
17 |
def display_company_sizes(df):
|
18 |
+
fig = px.histogram(df, x='tranche_effectif_entreprise',
|
19 |
labels={'tranche_effectif_entreprise':'Taille de l\'entreprise'}, template='plotly_white')
|
20 |
fig.update_traces(marker_color='green')
|
|
|
21 |
st.plotly_chart(fig)
|
22 |
|
23 |
def display_companies_by_commune(df):
|
24 |
commune_counts = df['commune'].value_counts(normalize=True).reset_index()
|
25 |
commune_counts.columns = ['Commune', 'Pourcentage']
|
26 |
+
fig = px.pie(commune_counts, values='Pourcentage', names='Commune',
|
27 |
template='plotly_white', hole=.3)
|
28 |
fig.update_traces(textinfo='percent+label')
|
|
|
29 |
st.plotly_chart(fig)
|
30 |
|
31 |
def display_rse_actions_wordcloud(df):
|