Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -202,7 +202,7 @@ else:
|
|
202 |
# calcualte cumulative score
|
203 |
total_scores = pd.Series()
|
204 |
for s in scores:
|
205 |
-
total_scores += s
|
206 |
print(total_scores, type(total_scores))
|
207 |
total_scores = total_scores.tolist()
|
208 |
print(total_scores, type(total_scores))
|
@@ -210,6 +210,9 @@ else:
|
|
210 |
print(total_scores, type(total_scores))
|
211 |
shelters['total_score'] = total_scores
|
212 |
|
|
|
|
|
|
|
213 |
shelters = [
|
214 |
{"title": "Shelter 1", "description": "This is the 1st shelter",},
|
215 |
{"title": "Shelter 2", "description": "This is the 2nd shelter.",},
|
|
|
202 |
# calcualte cumulative score
|
203 |
total_scores = pd.Series()
|
204 |
for s in scores:
|
205 |
+
total_scores += shelters[s]
|
206 |
print(total_scores, type(total_scores))
|
207 |
total_scores = total_scores.tolist()
|
208 |
print(total_scores, type(total_scores))
|
|
|
210 |
print(total_scores, type(total_scores))
|
211 |
shelters['total_score'] = total_scores
|
212 |
|
213 |
+
shelters = shelters.sort_values(by='total_score', ascending=False)
|
214 |
+
shelters = shelters.head(3)
|
215 |
+
|
216 |
shelters = [
|
217 |
{"title": "Shelter 1", "description": "This is the 1st shelter",},
|
218 |
{"title": "Shelter 2", "description": "This is the 2nd shelter.",},
|