CoolFace
Apppublic

Chittrarasu/Population_FastAPI

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes
population_pandas.cpython-313.pyc12 linesDownload Raw Back to __pycache__
12y�g7��p�SSKrSSKJr \R"S5r\R"S5 \RS5RSSS	S3SSS
S4S
S4S9R5r
\
S\
S-\
S'\R"S5 SrSrg!\ar\R"S\35 SrCN�SrCff=f)�N)�loggerzdata/world_population.csvzCSV file loaded successfully.zError loading CSV file: �	Continent)�Country�count)�4Population�sum)r�mean)�Arear)r�max)r�minrc�H�[RUR5S4$�Nr)�df�loc�idxmax��xs �4C:\chitu\population_api\backend\population_pandas.py�<lambda>r���B�F�F�1�8�8�:�y�;P�4Q�c�H�[RUR5S4$r)rr�idxminrs rrrrr)�Total_Countries�Total_Population�Average_Population�5Total_Area�max_population�min_population�Country_Max_Population�Country_Min_Populationrr�Population_DensityzData processing completed.c�\�[R"S5 [SR5$)z!Returns a list of all continents.zFetching all continents.r)r�info�continent_stats�tolist�rr�get_continentsr(s#��6�K�K�*�+��;�'�.�.�0�0rc���[R"SU35 [[SU:HR5nUR(a7"SU35 0$UR
5$)z,Returns statistics for a specific continent.zFetching data for continent: rzNo data found for continent: )rr$r%�squeeze�empty�warning�to_dict)�	continent�results  r�get_continent_datar0$s`��8�K�K�/�	�{�;�<�
�_�[�9�Y�F�
G�
O�
O�
Q�F�
�|�|����6�y�k�B�C��	��>�>��r)�pandas�pd�backend.loggerr�read_csvrr$�	Exception�e�error�groupby�agg�reset_indexr%r(r0r'rr�<module>r;s����!�1�	���0�	1�B�9�K�K�/�0�10�*�*�[�)�-�-�(�*�-��(�(�(�*Q�R�(�*Q�R�.�	��+�-���&�'�/�,�*G�G��$�%����(�)�1�11	��7�1�12�L�L�+�A�3�/�0�0��1�s�$B�B5�B0�0B5