Spaces:
Sleeping
Sleeping
nastasiasnk
commited on
Commit
•
850974d
1
Parent(s):
9c17797
Update app.py
Browse files
app.py
CHANGED
@@ -99,11 +99,11 @@ def test(input_json):
|
|
99 |
def landusesToSubdomains(DistanceMatrix, LanduseDf, LanduseToSubdomainDict, UniqueSubdomainsList):
|
100 |
df_LivabilitySubdomainsArea = pd.DataFrame(0, index=DistanceMatrix.index, columns=UniqueSubdomainsList)
|
101 |
|
102 |
-
for
|
103 |
-
for lu,
|
104 |
-
if
|
105 |
if lu in LanduseDf.columns:
|
106 |
-
df_LivabilitySubdomainsArea[
|
107 |
else:
|
108 |
print(f"Warning: Column '{lu}' not found in landuse database")
|
109 |
|
|
|
99 |
def landusesToSubdomains(DistanceMatrix, LanduseDf, LanduseToSubdomainDict, UniqueSubdomainsList):
|
100 |
df_LivabilitySubdomainsArea = pd.DataFrame(0, index=DistanceMatrix.index, columns=UniqueSubdomainsList)
|
101 |
|
102 |
+
for subdomain in UniqueSubdomainsList:
|
103 |
+
for lu, lu_subdomain in LanduseToSubdomainDict.items():
|
104 |
+
if lu_subdomain == subdomain:
|
105 |
if lu in LanduseDf.columns:
|
106 |
+
df_LivabilitySubdomainsArea[subdomain] = df_LivabilitySubdomainsArea[subdomain].add(LanduseDf[lu], fill_value=0)
|
107 |
else:
|
108 |
print(f"Warning: Column '{lu}' not found in landuse database")
|
109 |
|