Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -207,29 +207,28 @@ else:
|
|
207 |
shelters = shelters.head(3)
|
208 |
|
209 |
st.table(shelters)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
210 |
|
211 |
-
|
212 |
-
|
213 |
-
{"title": "Shelter 2", "description": "This is the 2nd shelter.",},
|
214 |
-
{"title": "Shelter 3", "description": "This is the 3rd shelter.",}
|
215 |
-
]
|
216 |
-
|
217 |
-
# Display the current shelter information
|
218 |
-
shelter = shelters[st.session_state.shelter_index]
|
219 |
-
st.write(shelter["description"])
|
220 |
-
|
221 |
-
# Create two columns
|
222 |
-
col1, col2 = st.columns([1,1])
|
223 |
|
224 |
-
# Add buttons to each column
|
225 |
-
with col1:
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
|
231 |
-
with col2:
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
|
|
207 |
shelters = shelters.head(3)
|
208 |
|
209 |
st.table(shelters)
|
210 |
+
|
211 |
+
# convert pandas df into list of dicts
|
212 |
+
shelters = shelters.to_dict(orient='records')
|
213 |
+
print(shelters)
|
214 |
+
print(type(shelters))
|
215 |
+
|
216 |
+
# # Display the current shelter information
|
217 |
+
# shelter = shelters[st.session_state.shelter_index]
|
218 |
+
# st.write(shelter["description"])
|
219 |
|
220 |
+
# # Create two columns
|
221 |
+
# col1, col2 = st.columns([1,1])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
222 |
|
223 |
+
# # Add buttons to each column
|
224 |
+
# with col1:
|
225 |
+
# if st.button("Previous"):
|
226 |
+
# if st.session_state.shelter_index > 0:
|
227 |
+
# st.session_state.shelter_index -= 1
|
228 |
+
# st.experimental_rerun()
|
229 |
|
230 |
+
# with col2:
|
231 |
+
# if st.button("Next"):
|
232 |
+
# if st.session_state.shelter_index < len(shelters) - 1:
|
233 |
+
# st.session_state.shelter_index += 1
|
234 |
+
# st.experimental_rerun()
|