Spaces:
Sleeping
Sleeping
nastasiasnk
commited on
Commit
•
edc370b
1
Parent(s):
0c12c76
Update app.py
Browse files
app.py
CHANGED
@@ -5,6 +5,15 @@ import json
|
|
5 |
from io import StringIO
|
6 |
from collections import OrderedDict
|
7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
def test(input_json):
|
9 |
print("Received input")
|
10 |
# Parse the input JSON string
|
@@ -100,10 +109,10 @@ def test(input_json):
|
|
100 |
livability_score = remap(subdomainsAccessibility[key], 0, threshold, 0, max_livability)
|
101 |
livability.loc[subdomainsAccessibility[key] >= threshold, key] = max_livability
|
102 |
livability.loc[subdomainsAccessibility[key] < threshold, key] = livability_score
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
|
108 |
return livability
|
109 |
|
|
|
5 |
from io import StringIO
|
6 |
from collections import OrderedDict
|
7 |
|
8 |
+
|
9 |
+
|
10 |
+
|
11 |
+
|
12 |
+
|
13 |
+
|
14 |
+
|
15 |
+
|
16 |
+
|
17 |
def test(input_json):
|
18 |
print("Received input")
|
19 |
# Parse the input JSON string
|
|
|
109 |
livability_score = remap(subdomainsAccessibility[key], 0, threshold, 0, max_livability)
|
110 |
livability.loc[subdomainsAccessibility[key] >= threshold, key] = max_livability
|
111 |
livability.loc[subdomainsAccessibility[key] < threshold, key] = livability_score
|
112 |
+
if any(domain):
|
113 |
+
for item in domain:
|
114 |
+
livability.loc[subdomainsAccessibility[key] >= threshold, domain] += max_livability
|
115 |
+
livability.loc[subdomainsAccessibility[key] < threshold, domain] += livability_score
|
116 |
|
117 |
return livability
|
118 |
|