JUNGU commited on
Commit
ba7c97e
·
verified ·
1 Parent(s): 65e42f5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -2
app.py CHANGED
@@ -83,10 +83,18 @@ with col1:
83
  # 기존 입력창
84
  for i in range(5):
85
  record_key = f"record_{i}"
86
- if record_key not in st.session_state:
 
 
 
 
 
 
 
87
  st.session_state[record_key] = ""
88
- st.text_area("생활기록부 내용 입력", key=record_key, height=150, value=st.session_state[record_key])
89
 
 
 
90
  with col2:
91
  # 키워드 선택 옵션
92
  st.write("키워드 선택")
 
83
  # 기존 입력창
84
  for i in range(5):
85
  record_key = f"record_{i}"
86
+ # 업로드된 데이터가 있고 해당 인덱스에 데이터가 있는 경우
87
+ if uploaded_data is not None and i < len(uploaded_data):
88
+ data_value = uploaded_data.iloc[i, 0]
89
+ if pd.isna(data_value):
90
+ st.session_state[record_key] = ""
91
+ else:
92
+ st.session_state[record_key] = str(data_value)
93
+ elif record_key not in st.session_state:
94
  st.session_state[record_key] = ""
 
95
 
96
+ with st.expander(f"입력창 {i+1}", expanded=False):
97
+ st.text_area("생활기록부 내용 입력", key=record_key, height=150, value=st.session_state[record_key])
98
  with col2:
99
  # 키워드 선택 옵션
100
  st.write("키워드 선택")