jonghhhh commited on
Commit
9312ce7
Β·
verified Β·
1 Parent(s): 6919349

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
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
- df = pd.DataFrame(data['KeyStatisticList']['row'])
43
- return df
 
 
 
 
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λŒ€ ν†΅κ³„μ§€ν‘œ μ‹€μ‹œκ°„ 확인":