dizzafizza1 commited on
Commit
f9c3119
1 Parent(s): efff3c6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -82,8 +82,8 @@ with st.form(key='log_medication'):
82
  submit_button = st.form_submit_button(label='Log Medication')
83
 
84
  if submit_button and medication_name and dosage:
85
- new_entry = {"Medication": medication_name, "Dosage": dosage, "Time": time_of_day, "Date": date}
86
- st.session_state.medications = st.session_state.medications.append(new_entry, ignore_index=True)
87
  st.success(f"Logged: {medication_name} - {dosage} at {time_of_day} on {date}")
88
 
89
  st.markdown('</div>', unsafe_allow_html=True)
 
82
  submit_button = st.form_submit_button(label='Log Medication')
83
 
84
  if submit_button and medication_name and dosage:
85
+ new_entry = pd.DataFrame({"Medication": [medication_name], "Dosage": [dosage], "Time": [time_of_day], "Date": [date]})
86
+ st.session_state.medications = pd.concat([st.session_state.medications, new_entry], ignore_index=True)
87
  st.success(f"Logged: {medication_name} - {dosage} at {time_of_day} on {date}")
88
 
89
  st.markdown('</div>', unsafe_allow_html=True)