nastasiasnk commited on
Commit
10608aa
·
verified ·
1 Parent(s): 0391643

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -1
app.py CHANGED
@@ -42,10 +42,26 @@ def test(input_json):
42
  df_landuses = df_landuses.round(0).astype(int)
43
 
44
 
 
 
 
 
 
 
 
45
  # create a mask based on the matrix size and ids, crop activity nodes to the mask
46
 
47
  mask_connected = df_matrix.index.tolist()
48
- df_landuses_filtered = df_landuses.loc[mask_connected]
 
 
 
 
 
 
 
 
 
49
 
50
  # find a set of unique domains, to which subdomains are aggregated
51
 
 
42
  df_landuses = df_landuses.round(0).astype(int)
43
 
44
 
45
+ """
46
+ if len(A) == len(B):
47
+ B.index = A
48
+ else:
49
+ print("The lengths do not match.")
50
+ """
51
+
52
  # create a mask based on the matrix size and ids, crop activity nodes to the mask
53
 
54
  mask_connected = df_matrix.index.tolist()
55
+
56
+ valid_indexes = [idx for idx in mask_connected if idx in df_landuses.index]
57
+ # Identify and report missing indexes
58
+ missing_indexes = set(mask_connected) - set(valid_indexes)
59
+ if missing_indexes:
60
+ print(f"Error: The following indexes were not found in the DataFrame: {missing_indexes}")
61
+
62
+ # Apply the filtered mask
63
+ df_landuses_filtered = df_landuses.loc[valid_indexes]
64
+
65
 
66
  # find a set of unique domains, to which subdomains are aggregated
67