File size: 1,807 Bytes
fe475ff
 
 
 
 
 
 
 
829bd84
 
fe475ff
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import os
import sys
src_directory = os.path.abspath(os.path.join(os.path.dirname(__file__), "../..", "frontend"))
sys.path.append(src_directory)
import streamlit as st
import streamlit_functions

st.title("World Population Data")
csv_file = "./world_population.csv"
# csv_file = st.file_uploader("Choose a CSV file", type=['csv'])

if csv_file:
    choosen_data = streamlit_functions.choose_data_view(st)
    if choosen_data == "Show All Continents":
        opt = choosen_data.replace(" ","")
        streamlit_functions.display_contents(opt, st)
    if choosen_data == "Show All Countries":
        opt = choosen_data.replace(" ","")
        streamlit_functions.display_contents(opt, st)
    if choosen_data == "Show Continent with Highest Population":
        opt = choosen_data.replace(" ","")
        streamlit_functions.display_contents(opt, st)
    if choosen_data == "Show Continent with Lowest Population":
        opt = choosen_data.replace(" ","")
        streamlit_functions.display_contents(opt, st)
    if choosen_data == "Show Country with Highest Population":
        opt = choosen_data.replace(" ","")
        streamlit_functions.display_contents(opt, st)
    if choosen_data == "Show Country with Lowest Population":
        opt = choosen_data.replace(" ","")
        streamlit_functions.display_contents(opt, st)
    








    # selected_stat = st.selectbox("Select the stat",stat_list)
    # list_of_selected_cont = home_page.list_country_by_continent(df,selected_continent)
    # selected_key = st.selectbox("Select the key's to fetch data:",df.keys())
    # max_population = home_page.get_continent_with_max_pop(df)
    # st.write(f"Countries data in {selected_continent}:", list_of_selected_cont)
    # st.write(f"{selected_continent}'s with max population is :",max_population)