Spaces:
Sleeping
Sleeping
nastasiasnk
commited on
Commit
•
87f9d6f
1
Parent(s):
9f66294
Update imports_utils.py
Browse files- imports_utils.py +11 -8
imports_utils.py
CHANGED
@@ -233,14 +233,17 @@ def FindWorkplacesNumber (DistanceMatrix,SubdomainAttributeDict,destinationWeigh
|
|
233 |
df_LivabilitySubdomainsWorkplaces = pd.DataFrame(0, index=DistanceMatrix.index, columns=['jobs'])
|
234 |
|
235 |
for subdomain in UniqueSubdomainsList:
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
|
|
|
|
|
|
244 |
return df_LivabilitySubdomainsWorkplaces
|
245 |
|
246 |
|
|
|
233 |
df_LivabilitySubdomainsWorkplaces = pd.DataFrame(0, index=DistanceMatrix.index, columns=['jobs'])
|
234 |
|
235 |
for subdomain in UniqueSubdomainsList:
|
236 |
+
for key, value_list in SubdomainAttributeDict.items():
|
237 |
+
if value_list['sqmPerEmpl']:
|
238 |
+
sqm_per_empl = float(SubdomainAttributeDict[subdomain]['sqmPerEmpl'])
|
239 |
+
if key in destinationWeights.columns and key == subdomain:
|
240 |
+
if sqm_per_empl > 0:
|
241 |
+
df_LivabilitySubdomainsWorkplaces['jobs'] += (round(destinationWeights[key] / sqm_per_empl,2)).fillna(0)
|
242 |
+
else:
|
243 |
+
df_LivabilitySubdomainsWorkplaces['jobs'] += 0
|
244 |
+
else:
|
245 |
+
df_LivabilitySubdomainsWorkplaces['jobs'] += 0
|
246 |
+
|
247 |
return df_LivabilitySubdomainsWorkplaces
|
248 |
|
249 |
|