Skip to content

Commit

Permalink
fixed indexing bug
Browse files Browse the repository at this point in the history
  • Loading branch information
TheColdIce committed Jan 22, 2024
1 parent 45f4d53 commit caf26af
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions gnn/preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,12 @@ def main():
df_nodes_test = get_nodes(df_bank_test)
df_edges_test = get_edges(df_bank_test, aggregated=True, directional=False)

df_nodes_train.reset_index(inplace=True)
node_to_index = pd.Series(df_nodes_train.index, index=df_nodes_train['account']).to_dict()
df_edges_train['src'] = df_edges_train['src'].map(node_to_index)
df_edges_train['dst'] = df_edges_train['dst'].map(node_to_index)
df_nodes_train.drop(columns=['account'], inplace=True)

df_nodes_test.reset_index(inplace=True)
node_to_index = pd.Series(df_nodes_test.index, index=df_nodes_test['account']).to_dict()
df_edges_test['src'] = df_edges_test['src'].map(node_to_index)
Expand Down

0 comments on commit caf26af

Please sign in to comment.