Spaces:
Sleeping
Sleeping
nastasiasnk
commited on
Commit
•
b01674f
1
Parent(s):
2c33725
Update app.py
Browse files
app.py
CHANGED
@@ -78,9 +78,11 @@ else:
|
|
78 |
df_lu = df_lu.set_index("ids", drop=False)
|
79 |
|
80 |
df_dm = matrices[distanceMatrixActivityNodes]
|
81 |
-
|
|
|
|
|
82 |
dm_dictionary = df_dm.to_dict('index')
|
83 |
-
df_dm_transport_dictionary = df_dm_transport.to_dict('index')
|
84 |
|
85 |
# filter activity nodes attributes
|
86 |
mask_connected = df_dm.index.tolist()
|
@@ -92,6 +94,8 @@ else:
|
|
92 |
df_lu_filtered = df_lu[lu_columns].loc[mask_connected]
|
93 |
df_lu_filtered.columns = [col.replace('lu+', '') for col in df_lu_filtered.columns]
|
94 |
df_lu_filtered.columns = [col.replace('ASSETS+', '') for col in df_lu_filtered.columns]
|
|
|
|
|
95 |
df_lu_filtered = df_lu_filtered.astype(int)
|
96 |
df_lu_filtered = df_lu_filtered.T.groupby(level=0).sum().T
|
97 |
|
@@ -118,16 +122,18 @@ def test(input_json):
|
|
118 |
landuses = inputs['input']["landuse_areas"]
|
119 |
|
120 |
dfLanduses = pd.DataFrame(landuses).T
|
|
|
121 |
dfLanduses = dfLanduses.round(0).astype(int)
|
122 |
|
123 |
dfMatrix = pd.DataFrame(matrix).T
|
|
|
124 |
dfMatrix = dfMatrix.round(0).astype(int)
|
125 |
else:
|
126 |
dfLanduses = df_lu_filtered.copy()
|
127 |
-
dfLanduses = dfLanduses.round(0).astype(int)
|
128 |
|
129 |
dfMatrix = df_dm.copy()
|
130 |
-
|
131 |
|
132 |
|
133 |
attributeMapperDict_gh = inputs['input']["attributeMapperDict"]
|
|
|
78 |
df_lu = df_lu.set_index("ids", drop=False)
|
79 |
|
80 |
df_dm = matrices[distanceMatrixActivityNodes]
|
81 |
+
dfMatrix = dfMatrix.round(0).astype(int)
|
82 |
+
|
83 |
+
#df_dm_transport = matrices[distanceMatrixTransportStops]
|
84 |
dm_dictionary = df_dm.to_dict('index')
|
85 |
+
#df_dm_transport_dictionary = df_dm_transport.to_dict('index')
|
86 |
|
87 |
# filter activity nodes attributes
|
88 |
mask_connected = df_dm.index.tolist()
|
|
|
94 |
df_lu_filtered = df_lu[lu_columns].loc[mask_connected]
|
95 |
df_lu_filtered.columns = [col.replace('lu+', '') for col in df_lu_filtered.columns]
|
96 |
df_lu_filtered.columns = [col.replace('ASSETS+', '') for col in df_lu_filtered.columns]
|
97 |
+
|
98 |
+
df_lu_filtered = df_lu_filtered.apply(pd.to_numeric, errors='coerce')
|
99 |
df_lu_filtered = df_lu_filtered.astype(int)
|
100 |
df_lu_filtered = df_lu_filtered.T.groupby(level=0).sum().T
|
101 |
|
|
|
122 |
landuses = inputs['input']["landuse_areas"]
|
123 |
|
124 |
dfLanduses = pd.DataFrame(landuses).T
|
125 |
+
dfLanduses = dfLanduses.apply(pd.to_numeric, errors='coerce')
|
126 |
dfLanduses = dfLanduses.round(0).astype(int)
|
127 |
|
128 |
dfMatrix = pd.DataFrame(matrix).T
|
129 |
+
dfMatrix = dfMatrix.apply(pd.to_numeric, errors='coerce')
|
130 |
dfMatrix = dfMatrix.round(0).astype(int)
|
131 |
else:
|
132 |
dfLanduses = df_lu_filtered.copy()
|
133 |
+
#dfLanduses = dfLanduses.round(0).astype(int)
|
134 |
|
135 |
dfMatrix = df_dm.copy()
|
136 |
+
|
137 |
|
138 |
|
139 |
attributeMapperDict_gh = inputs['input']["attributeMapperDict"]
|