CoolFace
Apppublic

LaurentTRIPIED/OpenData-Projet-RSE

sourceHugging Facemitupdated 2y agoView on Hugging Face
0likes
statistiques.cpython-312.pyc22 linesDownload Raw Back to __pycache__
12�;f���ddlZddlZddlmZddlmZddl	m3Z4mZddlm
Zd�Zd�Zd�Zd�Zd�Zed	k(re�yy)5�N)�get_data)�	WordCloud�	STOPWORDSc��|dj�j�}ddg|_tj|dddddid��}|jdd�	�|j
d�6�tj|�y)N�libelle_section_naf�Secteur�Nombre��plotly_white)�x�y�color�labels�templatei����F)�xaxis_tickangle�7showlegend)r)	�value_counts�reset_index�columns�px�bar�
update_layout�
update_traces�st�plotly_chart)�df�
sector_counts�figs   �NC:\Users\easy\Documents\A CLASSER\x-DEV\01-OPENDATA-Projet-RSE\statistiques.py�display_companies_by_sectorr 	s|���,�-�:�:�<�H�H�J�M�&��1�M��8�&�&��)�x���2���Q�C����c�e��<������'��O�O�C��c��tj|dddd�d��}|jd��|jd�	�t	j9|�y)10N�tranche_effectif_entreprisezTaille de l'entrepriser	)r#�countr)rrr�green)�marker_color)�yaxis_title)r�	histogramrrrr)rrs  r�display_company_sizesr)sT��11�,�,�r�:�=U�_g�h�tB�C�C����7��+����(��+��O�O�C�r!c���|djd��j�}ddg|_tj|dddd��}|jd	�12�t
j|�y)N�communeT)�	normalize�Commune�Pourcentagerg333333�?)�values�namesr�holez
percent+label)�textinfo)rrrr�pierrr)r�commune_countsrs   r�display_companies_by_communer5se���	�]�/�/�$�/�?�K�K�M�N�'��7�N��13�&�&��
�Y�(�r�3�C������/��O�O�C�r!c��tjd�tgd��}tj|�}djd�|dj
�D��}t|ddd�	�j|�}tj�\}}|j|d14��|jd�tj|�y)
NzNuage de mots Actions RSE)5�l�dzd �des�qui�ainsi�toute�hors�plus�cette�afin�viazd'�sa�dans�ont�avec�aux�ce�chezrD�cela�la�un�avons�parzc'estzs'est�aussi�leurszd'un�nos�les�sur�ses�tous�nous�du�notre�de�et�est�pour�le�une�se�en�au�à�que�sont�leur�son� c3� K�|]}|���y�w)N�)�.0�actions  r�	<genexpr>z0display_rse_actions_wordcloud.<locals>.<genexpr>'s����C�v�F�C�s��15action_rse�whitei i�)�	stopwords�background_color�width�height�bilinear)�
interpolation�off)r�header�setr�union�join�dropnar�generate�plt�subplots�imshow�axis�pyplot)r�custom_stopwordsrn�text�	wordcloudr�axs       r�display_rse_actions_wordcloudr�!s����I�I�)�*��\�]����� 0�1�I��8�8�C��L�)9�)@�)@�)B�C�C�D��I��s�[^�_�h�h�im�n�I��l�l�n�G�C���I�I�i�z�I�2��G�G�E�N��I�I�c�Nr!c��t�\}}tj|�}|js�t	j16d�t	j17d�t	jd�t|�t	jd�t|�t	jd�t|�t|�yy)Nz## OPEN DATA RSEu2### Statistiques sur les entreprises engagées RSEu4Répartition des entreprises par secteur d'activitéz&Distribution des tailles d'entreprisesz%Pourcentage d'entreprises par Commune)r�pd�	DataFrame�emptyr�markdownrur r)r5r�)�data�_rs   r�mainr�0s����j�G�D�!�	���d�	�B�
�8�8�18���&�'�19���H�I�20�	�	�H�I�#�B�'�21�	�	�:�;��b�!�22�	�	�9�:�$�R�(�%�b�)�r!�__main__)�	streamlitr�pandasr��plotly.express�expressr�data_managerrr�rr�matplotlib.pyplotrr{r r)r5r�r��__name__rhr!r�<module>r�sD�����!�*�����
�*� �z���F�r!