Spaces:
Sleeping
Sleeping
nastasiasnk
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -101,17 +101,19 @@ def test(input_json):
|
|
101 |
for key, values in SubdomainAttributeDict.items():
|
102 |
threshold = float(SubdomainAttributeDict[key]['thresholds'])
|
103 |
max_livability = float(SubdomainAttributeDict[key]['max_points'])
|
104 |
-
domain = SubdomainAttributeDict[key]['domain']
|
105 |
-
sqm_per_employee =
|
106 |
|
107 |
if key in subdomainsAccessibility.columns:
|
108 |
livability_score = remap(subdomainsAccessibility[key], 0, threshold, 0, max_livability)
|
109 |
livability.loc[subdomainsAccessibility[key] >= threshold, key] = max_livability
|
110 |
livability.loc[subdomainsAccessibility[key] < threshold, key] = livability_score
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
|
|
|
|
115 |
|
116 |
return livability
|
117 |
|
|
|
101 |
for key, values in SubdomainAttributeDict.items():
|
102 |
threshold = float(SubdomainAttributeDict[key]['thresholds'])
|
103 |
max_livability = float(SubdomainAttributeDict[key]['max_points'])
|
104 |
+
domain = [str(item) for item in SubdomainAttributeDict[key]['domain']]
|
105 |
+
sqm_per_employee = float(SubdomainAttributeDict[key]['sqmPerEmpl'])
|
106 |
|
107 |
if key in subdomainsAccessibility.columns:
|
108 |
livability_score = remap(subdomainsAccessibility[key], 0, threshold, 0, max_livability)
|
109 |
livability.loc[subdomainsAccessibility[key] >= threshold, key] = max_livability
|
110 |
livability.loc[subdomainsAccessibility[key] < threshold, key] = livability_score
|
111 |
+
if any(domain):
|
112 |
+
for item in domain:
|
113 |
+
livability.loc[subdomainsAccessibility[key] >= threshold, domain] += max_livability
|
114 |
+
livability.loc[subdomainsAccessibility[key] < threshold, domain] += livability_score
|
115 |
+
else:
|
116 |
+
livability.loc[subdomainsAccessibility[key] < threshold, domain] += 10
|
117 |
|
118 |
return livability
|
119 |
|