JUNGU commited on
Commit
1a09a89
ยท
verified ยท
1 Parent(s): 0330f36

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -9
app.py CHANGED
@@ -9,9 +9,15 @@ import matplotlib.pyplot as plt
9
  import matplotlib.font_manager as fm
10
 
11
  # ํ•œ๊ธ€ ํฐํŠธ ์„ค์ •
12
- font_path = "Pretendard-Bold.ttf" # ์‹ค์ œ ํฐํŠธ ํŒŒ์ผ ๊ฒฝ๋กœ๋กœ ๋ณ€๊ฒฝํ•ด์ฃผ์„ธ์š”
13
- fm.fontManager.addfont(font_path)
14
- plt.rc('font', family='Pretendard-Bold') # 'your_font_name'์„ ์‹ค์ œ ํฐํŠธ ์ด๋ฆ„์œผ๋กœ ๋ณ€๊ฒฝํ•ด์ฃผ์„ธ์š”
 
 
 
 
 
 
15
 
16
  def load_data(file):
17
  file_extension = file.name.split('.')[-1].lower()
@@ -33,7 +39,7 @@ def manual_data_entry():
33
  num_rows = st.number_input("์ดˆ๊ธฐ ํ–‰์˜ ์ˆ˜๋ฅผ ์ž…๋ ฅํ•˜์„ธ์š”:", min_value=1, value=5)
34
  data = pd.DataFrame(columns=col_names, index=range(num_rows))
35
 
36
- edited_data = st.experimental_data_editor(data, num_rows="dynamic")
37
 
38
  return edited_data
39
  return None
@@ -134,12 +140,13 @@ def main():
134
  data = manual_data_entry()
135
 
136
  if data is not None:
137
- st.write("๋ฐ์ดํ„ฐ ๋ฏธ๋ฆฌ๋ณด๊ธฐ:")
138
- st.write(data)
139
-
 
140
  if st.button("๋ฐ์ดํ„ฐ ๋ถ„์„ ์‹œ์ž‘"):
141
- data = preprocess_data(data)
142
- perform_analysis(data)
143
 
144
  if __name__ == "__main__":
145
  main()
 
9
  import matplotlib.font_manager as fm
10
 
11
  # ํ•œ๊ธ€ ํฐํŠธ ์„ค์ •
12
+ def set_font():
13
+ font_path = "path/to/your/Pretendard-Bold.ttf" # ์‹ค์ œ ํฐํŠธ ํŒŒ์ผ ๊ฒฝ๋กœ๋กœ ๋ณ€๊ฒฝํ•ด์ฃผ์„ธ์š”
14
+ fm.fontManager.addfont(font_path)
15
+ plt.rcParams['font.family'] = 'Pretendard-Bold' # 'Pretendard-Bold'๋ฅผ ์‹ค์ œ ํฐํŠธ ์ด๋ฆ„์œผ๋กœ ๋ณ€๊ฒฝํ•ด์ฃผ์„ธ์š”
16
+ plt.rcParams['axes.unicode_minus'] = False # ๋งˆ์ด๋„ˆ์Šค ๊ธฐํ˜ธ ๊นจ์ง ๋ฐฉ์ง€
17
+
18
+ # Streamlit ์„ค์ •์— ํฐํŠธ ์ ์šฉ
19
+ st.set_option('deprecation.showPyplotGlobalUse', False)
20
+ set_font()
21
 
22
  def load_data(file):
23
  file_extension = file.name.split('.')[-1].lower()
 
39
  num_rows = st.number_input("์ดˆ๊ธฐ ํ–‰์˜ ์ˆ˜๋ฅผ ์ž…๋ ฅํ•˜์„ธ์š”:", min_value=1, value=5)
40
  data = pd.DataFrame(columns=col_names, index=range(num_rows))
41
 
42
+ edited_data = st.data_editor(data, num_rows="dynamic")
43
 
44
  return edited_data
45
  return None
 
140
  data = manual_data_entry()
141
 
142
  if data is not None:
143
+ st.subheader("๋ฐ์ดํ„ฐ ๋ฏธ๋ฆฌ๋ณด๊ธฐ ๋ฐ ์ˆ˜์ •")
144
+ st.write("๋ฐ์ดํ„ฐ๋ฅผ ํ™•์ธํ•˜๊ณ  ํ•„์š”ํ•œ ๊ฒฝ์šฐ ์ˆ˜์ •ํ•˜์„ธ์š”:")
145
+ edited_data = st.data_editor(data, num_rows="dynamic")
146
+
147
  if st.button("๋ฐ์ดํ„ฐ ๋ถ„์„ ์‹œ์ž‘"):
148
+ processed_data = preprocess_data(edited_data)
149
+ perform_analysis(processed_data)
150
 
151
  if __name__ == "__main__":
152
  main()