Spaces:
Build error
Build error
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +153 -52
src/streamlit_app.py
CHANGED
|
@@ -6,30 +6,66 @@ import seaborn as sns
|
|
| 6 |
from scipy.stats import norm, skew
|
| 7 |
import platform
|
| 8 |
import os
|
| 9 |
-
import matplotlib.font_manager as fm
|
| 10 |
|
| 11 |
def set_korean_font():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
font_filename = "NanumGaRamYeonGgoc.ttf"
|
| 13 |
-
# ์ฑ ๋ฃจํธ ๋๋ ํฐ๋ฆฌ์์ ํฐํธ ํ์ผ ์ฐพ๊ธฐ
|
| 14 |
font_path = os.path.join(os.getcwd(), font_filename)
|
| 15 |
-
|
| 16 |
-
if
|
| 17 |
try:
|
| 18 |
-
|
| 19 |
fm.fontManager.addfont(font_path)
|
| 20 |
-
|
| 21 |
-
|
|
|
|
|
|
|
| 22 |
except Exception as e:
|
| 23 |
-
st.sidebar.
|
| 24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
st.sidebar.warning(
|
| 26 |
-
f"ํฐํธ
|
| 27 |
-
"์ฑ
|
| 28 |
)
|
| 29 |
-
|
|
|
|
| 30 |
plt.rcParams['axes.unicode_minus'] = False
|
| 31 |
|
| 32 |
-
#
|
|
|
|
|
|
|
| 33 |
def analyze_scores(df):
|
| 34 |
"""๋ฐ์ดํฐํ๋ ์์ ๋ฐ์ ๋ถ์ ๊ฒฐ๊ณผ๋ฅผ ํ์ํ๋ ํจ์"""
|
| 35 |
st.subheader("๋ฐ์ดํฐ ๋ฏธ๋ฆฌ๋ณด๊ธฐ (์์ 5๊ฐ)")
|
|
@@ -45,6 +81,12 @@ def analyze_scores(df):
|
|
| 45 |
|
| 46 |
if score_column:
|
| 47 |
scores = df[score_column].dropna()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
st.subheader(f"'{score_column}' ์ ์ ๋ถํฌ ๋ถ์ ๊ฒฐ๊ณผ")
|
| 49 |
|
| 50 |
# 1. ๊ธฐ์ ํต๊ณ๋
|
|
@@ -54,66 +96,125 @@ def analyze_scores(df):
|
|
| 54 |
# 2. ๋ถํฌ ์๊ฐํ
|
| 55 |
st.write("#### ๐จ ์ ์ ๋ถํฌ ์๊ฐํ")
|
| 56 |
fig, ax = plt.subplots(figsize=(10, 6))
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 66 |
|
| 67 |
# 3. ์๋(Skewness) ๋ถ์
|
| 68 |
st.write("#### ๐ ์๋ (Skewness) ๋ถ์")
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
|
|
|
|
|
|
|
|
|
| 78 |
|
| 79 |
-
# --- ๋ฉ์ธ ์คํ ํจ์ ---
|
| 80 |
def main():
|
| 81 |
-
st.set_page_config(
|
| 82 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
|
| 84 |
st.title("ํ์ ์ ์ ๋ถํฌ ๋ถ์ ๋๊ตฌ ๐")
|
| 85 |
st.write("CSV ํ์ผ์ ์ง์ ์
๋ก๋ํ๊ฑฐ๋ Google Sheets URL์ ๋ถ์ฌ๋ฃ์ด ํ์ ์ ์ ๋ถํฌ๋ฅผ ๋ถ์ํฉ๋๋ค.")
|
| 86 |
st.write("---")
|
| 87 |
|
| 88 |
-
st.sidebar.title("๋ฐ์ดํฐ ๊ฐ์ ธ์ค๊ธฐ")
|
| 89 |
-
source_option = st.sidebar.radio(
|
|
|
|
|
|
|
|
|
|
| 90 |
|
| 91 |
df = None
|
| 92 |
|
| 93 |
-
if source_option == "
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
except Exception as e:
|
| 100 |
-
st.error(f"URL๋ก๋ถํฐ ๋ฐ์ดํฐ๋ฅผ ์ฝ๋ ์ค ์ค๋ฅ๊ฐ ๋ฐ์ํ์ต๋๋ค: {e}")
|
| 101 |
-
st.warning("์ฌ๋ฐ๋ฅธ Google Sheets '์น ๊ฒ์' CSV URL์ธ์ง ํ์ธํด์ฃผ์ธ์.")
|
| 102 |
-
|
| 103 |
-
# [์์ 2] elif์ ๋ค์ฌ์ฐ๊ธฐ๋ฅผ ์์ ํ์ฌ if์ ๊ฐ์ ๋ ๋ฒจ๋ก ๋ง์ถค
|
| 104 |
-
elif source_option == "CSV ํ์ผ ์
๋ก๋":
|
| 105 |
-
uploaded_file = st.sidebar.file_uploader("CSV ํ์ผ์ ์
๋ก๋ํ์ธ์.", type="csv")
|
| 106 |
if uploaded_file:
|
| 107 |
try:
|
| 108 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 109 |
except Exception as e:
|
| 110 |
st.error(f"ํ์ผ์ ์ฝ๋ ์ค ์ค๋ฅ๊ฐ ๋ฐ์ํ์ต๋๋ค: {e}")
|
| 111 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 112 |
# ๋ฐ์ดํฐ๊ฐ ์ฑ๊ณต์ ์ผ๋ก ๋ก๋๋ ๊ฒฝ์ฐ์๋ง ๋ถ์ ํจ์ ์คํ
|
| 113 |
-
if df is not None:
|
|
|
|
| 114 |
analyze_scores(df)
|
| 115 |
else:
|
| 116 |
-
st.info("์ฌ์ด๋๋ฐ์์ ๋ฐ์ดํฐ ์์ค๋ฅผ ์ ํํ๊ณ ๋ฐ์ดํฐ๋ฅผ ๋ถ๋ฌ์์ฃผ์ธ์.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 117 |
|
| 118 |
if __name__ == '__main__':
|
| 119 |
main()
|
|
|
|
| 6 |
from scipy.stats import norm, skew
|
| 7 |
import platform
|
| 8 |
import os
|
| 9 |
+
import matplotlib.font_manager as fm
|
| 10 |
|
| 11 |
def set_korean_font():
|
| 12 |
+
"""ํ๊ธ ํฐํธ ์ค์ ํจ์ - ์ฌ๋ฌ ๋ฐฉ๋ฒ์ผ๋ก ์๋"""
|
| 13 |
+
|
| 14 |
+
# 1. ์์คํ
๊ธฐ๋ณธ ํ๊ธ ํฐํธ ์ฐพ๊ธฐ
|
| 15 |
+
available_fonts = [f.name for f in fm.fontManager.ttflist]
|
| 16 |
+
korean_fonts = [
|
| 17 |
+
'NanumGothic', 'NanumBarunGothic', 'NanumSquare',
|
| 18 |
+
'Malgun Gothic', 'AppleGothic', 'Noto Sans CJK KR',
|
| 19 |
+
'DejaVu Sans', 'Arial Unicode MS'
|
| 20 |
+
]
|
| 21 |
+
|
| 22 |
+
selected_font = None
|
| 23 |
+
|
| 24 |
+
# 2. ์ฌ์ฉ์ ์ง์ ํฐํธ ํ์ผ ํ์ธ
|
| 25 |
font_filename = "NanumGaRamYeonGgoc.ttf"
|
|
|
|
| 26 |
font_path = os.path.join(os.getcwd(), font_filename)
|
| 27 |
+
|
| 28 |
+
if os.path.exists(font_path):
|
| 29 |
try:
|
| 30 |
+
# ํฐํธ ํ์ผ์ ์์คํ
์ ๋ฑ๋ก
|
| 31 |
fm.fontManager.addfont(font_path)
|
| 32 |
+
font_prop = fm.FontProperties(fname=font_path)
|
| 33 |
+
selected_font = font_prop.get_name()
|
| 34 |
+
plt.rcParams['font.family'] = selected_font
|
| 35 |
+
st.sidebar.success(f"์ฌ์ฉ์ ํฐํธ '{selected_font}' ๋ก๋ฉ ์ฑ๊ณต!")
|
| 36 |
except Exception as e:
|
| 37 |
+
st.sidebar.warning(f"์ฌ์ฉ์ ํฐํธ ๋ก๋ฉ ์คํจ: {e}")
|
| 38 |
+
|
| 39 |
+
# 3. ์์คํ
ํฐํธ์์ ํ๊ธ ํฐํธ ์ฐพ๊ธฐ
|
| 40 |
+
if not selected_font:
|
| 41 |
+
for font in korean_fonts:
|
| 42 |
+
if font in available_fonts:
|
| 43 |
+
selected_font = font
|
| 44 |
+
plt.rcParams['font.family'] = font
|
| 45 |
+
st.sidebar.info(f"์์คํ
ํฐํธ '{font}' ์ฌ์ฉ ์ค")
|
| 46 |
+
break
|
| 47 |
+
|
| 48 |
+
# 4. ๋ชจ๋ ๋ฐฉ๋ฒ์ด ์คํจํ ๊ฒฝ์ฐ ๊ธฐ๋ณธ ์ค์
|
| 49 |
+
if not selected_font:
|
| 50 |
+
# ์ด์์ฒด์ ๋ณ ๊ธฐ๋ณธ ์ค์
|
| 51 |
+
if platform.system() == 'Windows':
|
| 52 |
+
plt.rcParams['font.family'] = 'Malgun Gothic'
|
| 53 |
+
elif platform.system() == 'Darwin': # macOS
|
| 54 |
+
plt.rcParams['font.family'] = 'AppleGothic'
|
| 55 |
+
else: # Linux
|
| 56 |
+
plt.rcParams['font.family'] = 'DejaVu Sans'
|
| 57 |
+
|
| 58 |
st.sidebar.warning(
|
| 59 |
+
f"ํ๊ธ ํฐํธ๋ฅผ ์ฐพ์ ์ ์์ด ๊ธฐ๋ณธ ํฐํธ๋ฅผ ์ฌ์ฉํฉ๋๋ค.\n"
|
| 60 |
+
f"'{font_filename}' ํ์ผ์ ์ฑ๊ณผ ๊ฐ์ ํด๋์ ๋ฃ์ผ๋ฉด ๋ ์ข์ ํ๊ธ ํ์๊ฐ ๊ฐ๋ฅํฉ๋๋ค."
|
| 61 |
)
|
| 62 |
+
|
| 63 |
+
# ๋ง์ด๋์ค ๊ธฐํธ ๊นจ์ง ๋ฐฉ์ง
|
| 64 |
plt.rcParams['axes.unicode_minus'] = False
|
| 65 |
|
| 66 |
+
# ํ์ฌ ์ค์ ๋ ํฐํธ ์ ๋ณด ํ์
|
| 67 |
+
st.sidebar.text(f"ํ์ฌ ํฐํธ: {plt.rcParams['font.family']}")
|
| 68 |
+
|
| 69 |
def analyze_scores(df):
|
| 70 |
"""๋ฐ์ดํฐํ๋ ์์ ๋ฐ์ ๋ถ์ ๊ฒฐ๊ณผ๋ฅผ ํ์ํ๋ ํจ์"""
|
| 71 |
st.subheader("๋ฐ์ดํฐ ๋ฏธ๋ฆฌ๋ณด๊ธฐ (์์ 5๊ฐ)")
|
|
|
|
| 81 |
|
| 82 |
if score_column:
|
| 83 |
scores = df[score_column].dropna()
|
| 84 |
+
|
| 85 |
+
# ์ ํจํ ๋ฐ์ดํฐ๊ฐ ์๋์ง ํ์ธ
|
| 86 |
+
if len(scores) == 0:
|
| 87 |
+
st.error("์ ํํ ์ด์ ์ ํจํ ๋ฐ์ดํฐ๊ฐ ์์ต๋๋ค.")
|
| 88 |
+
return
|
| 89 |
+
|
| 90 |
st.subheader(f"'{score_column}' ์ ์ ๋ถํฌ ๋ถ์ ๊ฒฐ๊ณผ")
|
| 91 |
|
| 92 |
# 1. ๊ธฐ์ ํต๊ณ๋
|
|
|
|
| 96 |
# 2. ๋ถํฌ ์๊ฐํ
|
| 97 |
st.write("#### ๐จ ์ ์ ๋ถํฌ ์๊ฐํ")
|
| 98 |
fig, ax = plt.subplots(figsize=(10, 6))
|
| 99 |
+
|
| 100 |
+
try:
|
| 101 |
+
sns.histplot(scores, kde=True, stat='density', label='ํ์ ์ ์ ๋ถํฌ', ax=ax)
|
| 102 |
+
mu, std = norm.fit(scores)
|
| 103 |
+
xmin, xmax = ax.get_xlim()
|
| 104 |
+
x = np.linspace(xmin, xmax, 100)
|
| 105 |
+
p = norm.pdf(x, mu, std)
|
| 106 |
+
ax.plot(x, p, 'k', linewidth=2, label='์ ๊ท๋ถํฌ ๊ณก์ ')
|
| 107 |
+
ax.set_title(f"'{score_column}' ์ ์ ๋ถํฌ (ํ๊ท : {mu:.2f}, ํ์คํธ์ฐจ: {std:.2f})")
|
| 108 |
+
ax.set_xlabel('์ ์')
|
| 109 |
+
ax.set_ylabel('๋ฐ๋')
|
| 110 |
+
ax.legend()
|
| 111 |
+
st.pyplot(fig)
|
| 112 |
+
except Exception as e:
|
| 113 |
+
st.error(f"๊ทธ๋ํ ์์ฑ ์ค ์ค๋ฅ ๏ฟฝ๏ฟฝ์: {e}")
|
| 114 |
+
finally:
|
| 115 |
+
plt.close(fig) # ๋ฉ๋ชจ๋ฆฌ ๋์ ๋ฐฉ์ง
|
| 116 |
|
| 117 |
# 3. ์๋(Skewness) ๋ถ์
|
| 118 |
st.write("#### ๐ ์๋ (Skewness) ๋ถ์")
|
| 119 |
+
try:
|
| 120 |
+
skewness = skew(scores)
|
| 121 |
+
st.metric(label="์๋ (Skewness)", value=f"{skewness:.4f}")
|
| 122 |
+
|
| 123 |
+
if skewness > 0.5:
|
| 124 |
+
st.info("๐ด ๊ผฌ๋ฆฌ๊ฐ ์ค๋ฅธ์ชฝ์ผ๋ก ๊ธด ๋ถํฌ (Positive Skew): ๋๋ถ๋ถ์ ํ์๋ค์ด ํ๊ท ๋ณด๋ค ๋ฎ์ ์ ์์ ๋ชฐ๋ ค์๊ณ , ์ผ๋ถ ๊ณ ๋์ ์๋ค์ด ํ๊ท ์ ๋์ด๊ณ ์์ต๋๋ค.")
|
| 125 |
+
elif skewness < -0.5:
|
| 126 |
+
st.info("๐ต ๊ผฌ๋ฆฌ๊ฐ ์ผ์ชฝ์ผ๋ก ๊ธด ๋ถํฌ (Negative Skew): ๋๋ถ๋ถ์ ํ์๋ค์ด ํ๊ท ๋ณด๋ค ๋์ ์ ์์ ๋ชฐ๋ ค์๊ณ , ์ผ๋ถ ์ ๋์ ์๋ค์ด ํ๊ท ์ ๋ฎ์ถ๊ณ ์์ต๋๋ค.")
|
| 127 |
+
else:
|
| 128 |
+
st.info("๐ข ๋์นญ์ ๊ฐ๊น์ด ๋ถํฌ: ์ ์๊ฐ ํ๊ท ์ ์ค์ฌ์ผ๋ก ๋น๊ต์ ๊ณ ๋ฅด๊ฒ ๋ถํฌ๋์ด ์์ต๋๋ค.")
|
| 129 |
+
except Exception as e:
|
| 130 |
+
st.error(f"์๋ ๊ณ์ฐ ์ค ์ค๋ฅ ๋ฐ์: {e}")
|
| 131 |
|
|
|
|
| 132 |
def main():
|
| 133 |
+
st.set_page_config(
|
| 134 |
+
page_title="ํ์ ์ ์ ๋ถ์",
|
| 135 |
+
page_icon="๐",
|
| 136 |
+
layout="wide"
|
| 137 |
+
)
|
| 138 |
+
|
| 139 |
+
# ํฐํธ ์ค์ ์ ๋จผ์ ์คํ
|
| 140 |
+
set_korean_font()
|
| 141 |
|
| 142 |
st.title("ํ์ ์ ์ ๋ถํฌ ๋ถ์ ๋๊ตฌ ๐")
|
| 143 |
st.write("CSV ํ์ผ์ ์ง์ ์
๋ก๋ํ๊ฑฐ๋ Google Sheets URL์ ๋ถ์ฌ๋ฃ์ด ํ์ ์ ์ ๋ถํฌ๋ฅผ ๋ถ์ํฉ๋๋ค.")
|
| 144 |
st.write("---")
|
| 145 |
|
| 146 |
+
st.sidebar.title("๐ ๋ฐ์ดํฐ ๊ฐ์ ธ์ค๊ธฐ")
|
| 147 |
+
source_option = st.sidebar.radio(
|
| 148 |
+
"๋ฐ์ดํฐ ์์ค๋ฅผ ์ ํํ์ธ์:",
|
| 149 |
+
("CSV ํ์ผ ์
๋ก๋", "Google Sheets URL")
|
| 150 |
+
)
|
| 151 |
|
| 152 |
df = None
|
| 153 |
|
| 154 |
+
if source_option == "CSV ํ์ผ ์
๋ก๋":
|
| 155 |
+
uploaded_file = st.sidebar.file_uploader(
|
| 156 |
+
"CSV ํ์ผ์ ์
๋ก๋ํ์ธ์.",
|
| 157 |
+
type=["csv"],
|
| 158 |
+
help="UTF-8 ๋๋ CP949 ์ธ์ฝ๋ฉ๋ CSV ํ์ผ์ ์ ํํ์ธ์."
|
| 159 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 160 |
if uploaded_file:
|
| 161 |
try:
|
| 162 |
+
# ์ฌ๋ฌ ์ธ์ฝ๋ฉ ๋ฐฉ์์ผ๋ก ์๋
|
| 163 |
+
encodings = ['utf-8-sig', 'utf-8', 'cp949', 'euc-kr']
|
| 164 |
+
for encoding in encodings:
|
| 165 |
+
try:
|
| 166 |
+
df = pd.read_csv(uploaded_file, encoding=encoding)
|
| 167 |
+
st.sidebar.success(f"ํ์ผ ์ฝ๊ธฐ ์ฑ๊ณต! (์ธ์ฝ๋ฉ: {encoding})")
|
| 168 |
+
break
|
| 169 |
+
except UnicodeDecodeError:
|
| 170 |
+
continue
|
| 171 |
+
|
| 172 |
+
if df is None:
|
| 173 |
+
st.error("ํ์ผ ์ธ์ฝ๋ฉ์ ์ธ์ํ ์ ์์ต๋๋ค. UTF-8 ๋๋ CP949๋ก ์ ์ฅ๋ ํ์ผ์ ์ฌ์ฉํด์ฃผ์ธ์.")
|
| 174 |
+
|
| 175 |
except Exception as e:
|
| 176 |
st.error(f"ํ์ผ์ ์ฝ๋ ์ค ์ค๋ฅ๊ฐ ๋ฐ์ํ์ต๋๋ค: {e}")
|
| 177 |
|
| 178 |
+
elif source_option == "Google Sheets URL":
|
| 179 |
+
st.sidebar.info("Google Sheets๋ฅผ '์น์ ๊ฒ์'ํ๊ณ CSV ํ์์ URL์ ์
๋ ฅํ์ธ์.")
|
| 180 |
+
sample_url = "https://docs.google.com/spreadsheets/d/e/2PACX-1vSGdxUwlxDVZXlqFJtLMPcZbKt_B3qBAUSj-hO-EwnG25iQRR3wxWVT9X54a1XkhBVw-BSEIXfeWKg6/pub?gid=966112810&single=true&output=csv"
|
| 181 |
+
url = st.sidebar.text_input(
|
| 182 |
+
"Google Sheets CSV URL",
|
| 183 |
+
value="",
|
| 184 |
+
placeholder="https://docs.google.com/spreadsheets/d/..."
|
| 185 |
+
)
|
| 186 |
+
|
| 187 |
+
if url:
|
| 188 |
+
if "docs.google.com" not in url:
|
| 189 |
+
st.sidebar.warning("์ฌ๋ฐ๋ฅธ Google Sheets URL์ธ์ง ํ์ธํด์ฃผ์ธ์.")
|
| 190 |
+
else:
|
| 191 |
+
try:
|
| 192 |
+
with st.spinner("๋ฐ์ดํฐ๋ฅผ ๋ถ๋ฌ์ค๋ ์ค..."):
|
| 193 |
+
df = pd.read_csv(url)
|
| 194 |
+
st.sidebar.success("Google Sheets ๋ฐ์ดํฐ ๋ก๋ฉ ์ฑ๊ณต!")
|
| 195 |
+
except Exception as e:
|
| 196 |
+
st.error(f"URL๋ก๋ถํฐ ๋ฐ์ดํฐ๋ฅผ ์ฝ๋ ์ค ์ค๋ฅ๊ฐ ๋ฐ์ํ์ต๋๋ค: {e}")
|
| 197 |
+
st.warning("์ฌ๋ฐ๋ฅธ Google Sheets '์น ๊ฒ์' CSV URL์ธ์ง ํ์ธํด์ฃผ์ธ์.")
|
| 198 |
+
|
| 199 |
# ๋ฐ์ดํฐ๊ฐ ์ฑ๊ณต์ ์ผ๋ก ๋ก๋๋ ๊ฒฝ์ฐ์๋ง ๋ถ์ ํจ์ ์คํ
|
| 200 |
+
if df is not None and not df.empty:
|
| 201 |
+
st.success(f"๋ฐ์ดํฐ ๋ก๋ฉ ์๋ฃ! (ํ: {len(df)}, ์ด: {len(df.columns)})")
|
| 202 |
analyze_scores(df)
|
| 203 |
else:
|
| 204 |
+
st.info("๐ ์ฌ์ด๋๋ฐ์์ ๋ฐ์ดํฐ ์์ค๋ฅผ ์ ํํ๊ณ ๋ฐ์ดํฐ๋ฅผ ๋ถ๋ฌ์์ฃผ์ธ์.")
|
| 205 |
+
|
| 206 |
+
# ์ํ ๋ฐ์ดํฐ ์์ฑ ๋ฒํผ
|
| 207 |
+
if st.button("๐ฒ ์ํ ๋ฐ์ดํฐ๋ก ํ
์คํธ"):
|
| 208 |
+
np.random.seed(42)
|
| 209 |
+
sample_data = {
|
| 210 |
+
'ํ์๋ฒํธ': range(1, 101),
|
| 211 |
+
'์ํ์ ์': np.random.normal(75, 15, 100).clip(0, 100).round(1),
|
| 212 |
+
'์์ด์ ์': np.random.normal(80, 12, 100).clip(0, 100).round(1),
|
| 213 |
+
'๊ณผํ์ ์': np.random.normal(70, 18, 100).clip(0, 100).round(1)
|
| 214 |
+
}
|
| 215 |
+
df = pd.DataFrame(sample_data)
|
| 216 |
+
st.success("์ํ ๋ฐ์ดํฐ๊ฐ ์์ฑ๋์์ต๋๋ค!")
|
| 217 |
+
analyze_scores(df)
|
| 218 |
|
| 219 |
if __name__ == '__main__':
|
| 220 |
main()
|