Update app.py
Browse files
app.py
CHANGED
|
@@ -39,8 +39,12 @@ def get_top_100_statistics():
|
|
| 39 |
response = requests.get(url)
|
| 40 |
if response.status_code == 200:
|
| 41 |
data = response.json()
|
| 42 |
-
|
| 43 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
else:
|
| 45 |
st.error(f"Failed to retrieve data: {response.status_code}")
|
| 46 |
return None
|
|
@@ -71,6 +75,7 @@ if menu == "ν΅κ³ μ½λ μ‘°ν λ° λ°μ΄ν° λΆμ":
|
|
| 71 |
if st.button("ν΅κ³ λ°μ΄ν° μ‘°ν"):
|
| 72 |
stat_data_df = get_statistic_data(selected_code, period, start_date, end_date)
|
| 73 |
if stat_data_df is not None:
|
|
|
|
| 74 |
st.dataframe(stat_data_df)
|
| 75 |
|
| 76 |
elif menu == "100λ ν΅κ³μ§ν μ€μκ° νμΈ":
|
|
|
|
| 39 |
response = requests.get(url)
|
| 40 |
if response.status_code == 200:
|
| 41 |
data = response.json()
|
| 42 |
+
if 'KeyStatisticList' in data:
|
| 43 |
+
df = pd.DataFrame(data['KeyStatisticList']['row'])
|
| 44 |
+
return df
|
| 45 |
+
else:
|
| 46 |
+
st.error("100λ ν΅κ³μ§ν λ°μ΄ν°λ₯Ό μ°Ύμ μ μμ΅λλ€.")
|
| 47 |
+
return None
|
| 48 |
else:
|
| 49 |
st.error(f"Failed to retrieve data: {response.status_code}")
|
| 50 |
return None
|
|
|
|
| 75 |
if st.button("ν΅κ³ λ°μ΄ν° μ‘°ν"):
|
| 76 |
stat_data_df = get_statistic_data(selected_code, period, start_date, end_date)
|
| 77 |
if stat_data_df is not None:
|
| 78 |
+
st.write(f"μ νν ν΅κ³ μ½λ: {selected_code}")
|
| 79 |
st.dataframe(stat_data_df)
|
| 80 |
|
| 81 |
elif menu == "100λ ν΅κ³μ§ν μ€μκ° νμΈ":
|