Spaces:
Sleeping
Sleeping
nastasiasnk
commited on
Commit
•
c23380f
1
Parent(s):
cc63a78
Update app.py
Browse files
app.py
CHANGED
@@ -162,21 +162,6 @@ def test(input_json):
|
|
162 |
# List containing the substrings to check against
|
163 |
tranportModes = ["DRT", "GMT", "HSR"]
|
164 |
|
165 |
-
"""
|
166 |
-
def splitDictByStrFragmentInColumnName(original_dict, substrings):
|
167 |
-
result_dicts = {substring: {} for substring in substrings}
|
168 |
-
|
169 |
-
for key, nested_dict in original_dict.items():
|
170 |
-
for subkey, value in nested_dict.items():
|
171 |
-
for substring in substrings:
|
172 |
-
if substring in subkey:
|
173 |
-
if key not in result_dicts[substring]:
|
174 |
-
result_dicts[substring][key] = {}
|
175 |
-
result_dicts[substring][key][subkey] = value
|
176 |
-
|
177 |
-
return result_dicts
|
178 |
-
|
179 |
-
"""
|
180 |
result_dicts = splitDictByStrFragmentInColumnName(df_dm_transport_dictionary, tranportModes)
|
181 |
|
182 |
# Accessing each dictionary
|
@@ -231,8 +216,9 @@ def test(input_json):
|
|
231 |
|
232 |
|
233 |
|
234 |
-
|
235 |
-
|
|
|
236 |
def landusesToSubdomains(DistanceMatrix, LanduseDf, LanduseToSubdomainDict, UniqueSubdomainsList):
|
237 |
df_LivabilitySubdomainsArea = pd.DataFrame(0, index=DistanceMatrix.index, columns=UniqueSubdomainsList)
|
238 |
|
@@ -247,7 +233,7 @@ def test(input_json):
|
|
247 |
return df_LivabilitySubdomainsArea
|
248 |
|
249 |
|
250 |
-
|
251 |
LivabilitySubdomainsWeights = landusesToSubdomains(df_dm,df_landuses_filtered,landuseMapperDict,subdomainsUnique)
|
252 |
|
253 |
|
|
|
162 |
# List containing the substrings to check against
|
163 |
tranportModes = ["DRT", "GMT", "HSR"]
|
164 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
165 |
result_dicts = splitDictByStrFragmentInColumnName(df_dm_transport_dictionary, tranportModes)
|
166 |
|
167 |
# Accessing each dictionary
|
|
|
216 |
|
217 |
|
218 |
|
219 |
+
from imports_utils import landusesToSubdomains
|
220 |
+
|
221 |
+
"""
|
222 |
def landusesToSubdomains(DistanceMatrix, LanduseDf, LanduseToSubdomainDict, UniqueSubdomainsList):
|
223 |
df_LivabilitySubdomainsArea = pd.DataFrame(0, index=DistanceMatrix.index, columns=UniqueSubdomainsList)
|
224 |
|
|
|
233 |
return df_LivabilitySubdomainsArea
|
234 |
|
235 |
|
236 |
+
"""
|
237 |
LivabilitySubdomainsWeights = landusesToSubdomains(df_dm,df_landuses_filtered,landuseMapperDict,subdomainsUnique)
|
238 |
|
239 |
|