Spaces:
Sleeping
Sleeping
nastasiasnk
commited on
Commit
•
7cdf6fe
1
Parent(s):
9c82a2c
Update app.py
Browse files
app.py
CHANGED
@@ -232,22 +232,23 @@ def test(input_json):
|
|
232 |
threshold = float(SubdomainAttributeDict[key]['thresholds'])
|
233 |
max_livability = float(SubdomainAttributeDict[key]['max_points'])
|
234 |
domain = [str(item) for item in SubdomainAttributeDict[key]['domain']]
|
235 |
-
|
236 |
if key == 'commercial':
|
237 |
livability_score = remap(subdomainsAccessibility['jobs'], 0, threshold, 0, max_livability)
|
238 |
-
livability.loc[subdomainsAccessibility['jobs'] >= threshold,
|
239 |
-
livability.loc[subdomainsAccessibility['jobs'] < threshold,
|
240 |
-
|
241 |
elif key in subdomainsAccessibility.columns and key != 'commercial':
|
242 |
livability_score = remap(subdomainsAccessibility[key], 0, threshold, 0, max_livability)
|
243 |
livability.loc[subdomainsAccessibility[key] >= threshold, key] = max_livability
|
244 |
livability.loc[subdomainsAccessibility[key] < threshold, key] = livability_score
|
|
|
245 |
if any(domain):
|
246 |
for item in domain:
|
247 |
if domain != 'Workplaces':
|
248 |
livability.loc[subdomainsAccessibility[key] >= threshold, item] += max_livability
|
249 |
livability.loc[subdomainsAccessibility[key] < threshold, item] += livability_score
|
250 |
-
|
251 |
|
252 |
#livability = livability.rename(columns={'jobs': 'Workplaces'})
|
253 |
|
|
|
232 |
threshold = float(SubdomainAttributeDict[key]['thresholds'])
|
233 |
max_livability = float(SubdomainAttributeDict[key]['max_points'])
|
234 |
domain = [str(item) for item in SubdomainAttributeDict[key]['domain']]
|
235 |
+
|
236 |
if key == 'commercial':
|
237 |
livability_score = remap(subdomainsAccessibility['jobs'], 0, threshold, 0, max_livability)
|
238 |
+
livability.loc[subdomainsAccessibility['jobs'] >= threshold, domain[0]] = max_livability
|
239 |
+
livability.loc[subdomainsAccessibility['jobs'] < threshold, domain[0]] = livability_score
|
240 |
+
|
241 |
elif key in subdomainsAccessibility.columns and key != 'commercial':
|
242 |
livability_score = remap(subdomainsAccessibility[key], 0, threshold, 0, max_livability)
|
243 |
livability.loc[subdomainsAccessibility[key] >= threshold, key] = max_livability
|
244 |
livability.loc[subdomainsAccessibility[key] < threshold, key] = livability_score
|
245 |
+
"""
|
246 |
if any(domain):
|
247 |
for item in domain:
|
248 |
if domain != 'Workplaces':
|
249 |
livability.loc[subdomainsAccessibility[key] >= threshold, item] += max_livability
|
250 |
livability.loc[subdomainsAccessibility[key] < threshold, item] += livability_score
|
251 |
+
"""
|
252 |
|
253 |
#livability = livability.rename(columns={'jobs': 'Workplaces'})
|
254 |
|