Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -5,12 +5,10 @@ import plotly.express as px
|
|
5 |
import plotly.graph_objects as go
|
6 |
from io import StringIO
|
7 |
import openpyxl
|
8 |
-
from st_aggrid import AgGrid, GridUpdateMode
|
9 |
-
from st_aggrid.grid_options_builder import GridOptionsBuilder
|
10 |
import matplotlib.font_manager as fm
|
11 |
|
12 |
# ํ๊ธ ํฐํธ ์ค์
|
13 |
-
font_path = "
|
14 |
fm.fontManager.addfont(font_path)
|
15 |
plt.rc('font', family='Pretendard-Bold') # 'your_font_name'์ ์ค์ ํฐํธ ์ด๋ฆ์ผ๋ก ๋ณ๊ฒฝํด์ฃผ์ธ์
|
16 |
|
@@ -31,18 +29,12 @@ def manual_data_entry():
|
|
31 |
col_names = [name.strip() for name in col_names if name.strip()]
|
32 |
|
33 |
if col_names:
|
34 |
-
num_rows = st.number_input("ํ์ ์๋ฅผ ์
๋ ฅํ์ธ์:", min_value=1, value=5)
|
35 |
data = pd.DataFrame(columns=col_names, index=range(num_rows))
|
36 |
|
37 |
-
|
38 |
-
gd.configure_default_column(editable=True)
|
39 |
-
gridoptions = gd.build()
|
40 |
|
41 |
-
|
42 |
-
update_mode=GridUpdateMode.VALUE_CHANGED,
|
43 |
-
height=400)
|
44 |
-
|
45 |
-
return grid_table['data']
|
46 |
return None
|
47 |
|
48 |
def preprocess_data(data):
|
@@ -140,10 +132,11 @@ def main():
|
|
140 |
|
141 |
if data is not None:
|
142 |
st.write("๋ฐ์ดํฐ ๋ฏธ๋ฆฌ๋ณด๊ธฐ:")
|
143 |
-
st.write(data
|
144 |
|
145 |
-
|
146 |
-
|
|
|
147 |
|
148 |
if __name__ == "__main__":
|
149 |
main()
|
|
|
5 |
import plotly.graph_objects as go
|
6 |
from io import StringIO
|
7 |
import openpyxl
|
|
|
|
|
8 |
import matplotlib.font_manager as fm
|
9 |
|
10 |
# ํ๊ธ ํฐํธ ์ค์
|
11 |
+
font_path = "Pretendard-Bold.ttf" # ์ค์ ํฐํธ ํ์ผ ๊ฒฝ๋ก๋ก ๋ณ๊ฒฝํด์ฃผ์ธ์
|
12 |
fm.fontManager.addfont(font_path)
|
13 |
plt.rc('font', family='Pretendard-Bold') # 'your_font_name'์ ์ค์ ํฐํธ ์ด๋ฆ์ผ๋ก ๋ณ๊ฒฝํด์ฃผ์ธ์
|
14 |
|
|
|
29 |
col_names = [name.strip() for name in col_names if name.strip()]
|
30 |
|
31 |
if col_names:
|
32 |
+
num_rows = st.number_input("์ด๊ธฐ ํ์ ์๋ฅผ ์
๋ ฅํ์ธ์:", min_value=1, value=5)
|
33 |
data = pd.DataFrame(columns=col_names, index=range(num_rows))
|
34 |
|
35 |
+
edited_data = st.experimental_data_editor(data, num_rows="dynamic")
|
|
|
|
|
36 |
|
37 |
+
return edited_data
|
|
|
|
|
|
|
|
|
38 |
return None
|
39 |
|
40 |
def preprocess_data(data):
|
|
|
132 |
|
133 |
if data is not None:
|
134 |
st.write("๋ฐ์ดํฐ ๋ฏธ๋ฆฌ๋ณด๊ธฐ:")
|
135 |
+
st.write(data)
|
136 |
|
137 |
+
if st.button("๋ฐ์ดํฐ ๋ถ์ ์์"):
|
138 |
+
data = preprocess_data(data)
|
139 |
+
perform_analysis(data)
|
140 |
|
141 |
if __name__ == "__main__":
|
142 |
main()
|