message
Browse files
app.py
CHANGED
@@ -21,14 +21,14 @@ if st.sidebar.button("Get Data"):
|
|
21 |
|
22 |
if response.status_code == 200:
|
23 |
try:
|
24 |
-
data = response.json()
|
25 |
|
26 |
st.header(f"π {selected_continent} - Population Statistics")
|
27 |
|
28 |
# Display data in Streamlit
|
29 |
st.write(f"π’ **Max Population:** {data.get('Max', 'N/A')}")
|
30 |
st.write(f"π΄ **Min Population:** {data.get('Min', 'N/A')}")
|
31 |
-
st.write(f"π **Average Population:** {data.get('
|
32 |
st.write(f"π **Total Area:** {data.get('Area', 'N/A')}")
|
33 |
st.write(f"π₯ **Total Population:** {data.get('Sum', 'N/A')}")
|
34 |
st.write(f"π **Population Density:** {data.get('density', 'N/A')}")
|
@@ -40,5 +40,4 @@ if st.sidebar.button("Get Data"):
|
|
40 |
st.error(f"API Error {response.status_code}: {response.text}")
|
41 |
|
42 |
except requests.exceptions.RequestException as e:
|
43 |
-
st.error(f"Request failed: {e}")
|
44 |
-
|
|
|
21 |
|
22 |
if response.status_code == 200:
|
23 |
try:
|
24 |
+
data = response.json()
|
25 |
|
26 |
st.header(f"π {selected_continent} - Population Statistics")
|
27 |
|
28 |
# Display data in Streamlit
|
29 |
st.write(f"π’ **Max Population:** {data.get('Max', 'N/A')}")
|
30 |
st.write(f"π΄ **Min Population:** {data.get('Min', 'N/A')}")
|
31 |
+
st.write(f"π **Average Population:** {data.get('Avgerage', 'N/A')}")
|
32 |
st.write(f"π **Total Area:** {data.get('Area', 'N/A')}")
|
33 |
st.write(f"π₯ **Total Population:** {data.get('Sum', 'N/A')}")
|
34 |
st.write(f"π **Population Density:** {data.get('density', 'N/A')}")
|
|
|
40 |
st.error(f"API Error {response.status_code}: {response.text}")
|
41 |
|
42 |
except requests.exceptions.RequestException as e:
|
43 |
+
st.error(f"Request failed: {e}")
|
|