Spaces:
Build error
Build 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()
|