Skip to content

Commit

Permalink
do not overwrite index (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
hwijeen authored Jan 8, 2024
1 parent 5c123bf commit 2f373cf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion analog/analysis/influence_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ def compute_influence(
assert total_influence.shape[1] == len(tgt_ids)
# Ensure src_ids and tgt_ids are in the DataFrame's index and columns, respectively
self.influence_scores = self.influence_scores.reindex(
index=src_ids, columns=tgt_ids
index=self.influence_scores.index.union(src_ids),
columns=self.influence_scores.columns.union(tgt_ids),
)

# Assign total_influence values to the corresponding locations in influence_scores
Expand Down

0 comments on commit 2f373cf

Please sign in to comment.