Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,21 +12,30 @@ page = st.sidebar.radio("νμ΄μ§ μ ν", ["μ°λ Ήλ λ° μ±λ³μ λ°λ₯Έ μ
|
|
| 12 |
|
| 13 |
def load_data(file_path):
|
| 14 |
try:
|
| 15 |
-
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
except Exception as e:
|
| 18 |
st.error(f"λ°μ΄ν°λ₯Ό λ‘λνλ λμ μ€λ₯κ° λ°μνμ΅λλ€: {e}")
|
| 19 |
return pd.DataFrame()
|
| 20 |
|
| 21 |
# ν°νΈ μ€μ
|
| 22 |
def set_font():
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
|
|
|
|
|
|
| 27 |
|
| 28 |
-
|
| 29 |
-
|
|
|
|
|
|
|
|
|
|
| 30 |
|
| 31 |
if page == "μ°λ Ήλ λ° μ±λ³μ λ°λ₯Έ μμ 5κ° λμΆ λμ":
|
| 32 |
st.title("μ°λ Ήλ λ° μ±λ³μ λ°λ₯Έ μμ 5κ° λμΆ λμ")
|
|
@@ -75,7 +84,7 @@ elif page == "μ°λ Ήλ λ° μ±λ³μ λ°λ₯Έ μμ 3κ° μ₯λ₯΄":
|
|
| 75 |
st.title("μ°λ Ήλ λ° μ±λ³μ λ°λ₯Έ μμ 3κ° μ₯λ₯΄")
|
| 76 |
|
| 77 |
# λ°μ΄ν° λ‘λ
|
| 78 |
-
df = load_data(
|
| 79 |
if df.empty:
|
| 80 |
st.stop()
|
| 81 |
|
|
@@ -102,7 +111,7 @@ elif page == "μ°λ Ήλ λ° μ±λ³μ λ°λ₯Έ μμ 3κ° μ₯λ₯΄":
|
|
| 102 |
image_path = 'heat_map_page-0001.jpg'
|
| 103 |
|
| 104 |
# μ΄λ―Έμ§ μ
λ‘λ λ° νμ
|
| 105 |
-
if image_path:
|
| 106 |
st.image(image_path, caption="ννΈλ§΅", use_column_width=True)
|
| 107 |
else:
|
| 108 |
st.write("μ΄λ―Έμ§ νμΌμ μ°Ύμ μ μμ΅λλ€.")
|
|
|
|
| 12 |
|
| 13 |
def load_data(file_path):
|
| 14 |
try:
|
| 15 |
+
if os.path.isfile(file_path):
|
| 16 |
+
df = pd.read_excel(file_path, sheet_name=None)
|
| 17 |
+
return pd.concat(df.values())
|
| 18 |
+
else:
|
| 19 |
+
st.error(f"νμΌμ μ°Ύμ μ μμ΅λλ€: {file_path}")
|
| 20 |
+
return pd.DataFrame()
|
| 21 |
except Exception as e:
|
| 22 |
st.error(f"λ°μ΄ν°λ₯Ό λ‘λνλ λμ μ€λ₯κ° λ°μνμ΅λλ€: {e}")
|
| 23 |
return pd.DataFrame()
|
| 24 |
|
| 25 |
# ν°νΈ μ€μ
|
| 26 |
def set_font():
|
| 27 |
+
# Hancom Gothic Regularμ ν°νΈ νμΌ κ²½λ‘ νμΈ
|
| 28 |
+
font_path = None
|
| 29 |
+
for font in fm.fontManager.ttflist:
|
| 30 |
+
if "Hancom Gothic Regular" in font.name:
|
| 31 |
+
font_path = font.fname
|
| 32 |
+
break
|
| 33 |
|
| 34 |
+
if font_path:
|
| 35 |
+
font_prop = fm.FontProperties(fname=font_path)
|
| 36 |
+
rc('font', family=font_prop.get_name())
|
| 37 |
+
else:
|
| 38 |
+
st.error("Hancom Gothic Regular ν°νΈλ₯Ό μ°Ύμ μ μμ΅λλ€.")
|
| 39 |
|
| 40 |
if page == "μ°λ Ήλ λ° μ±λ³μ λ°λ₯Έ μμ 5κ° λμΆ λμ":
|
| 41 |
st.title("μ°λ Ήλ λ° μ±λ³μ λ°λ₯Έ μμ 5κ° λμΆ λμ")
|
|
|
|
| 84 |
st.title("μ°λ Ήλ λ° μ±λ³μ λ°λ₯Έ μμ 3κ° μ₯λ₯΄")
|
| 85 |
|
| 86 |
# λ°μ΄ν° λ‘λ
|
| 87 |
+
df = load_data('μμ_3_μ₯λ₯΄.xlsx')
|
| 88 |
if df.empty:
|
| 89 |
st.stop()
|
| 90 |
|
|
|
|
| 111 |
image_path = 'heat_map_page-0001.jpg'
|
| 112 |
|
| 113 |
# μ΄λ―Έμ§ μ
λ‘λ λ° νμ
|
| 114 |
+
if os.path.isfile(image_path):
|
| 115 |
st.image(image_path, caption="ννΈλ§΅", use_column_width=True)
|
| 116 |
else:
|
| 117 |
st.write("μ΄λ―Έμ§ νμΌμ μ°Ύμ μ μμ΅λλ€.")
|