Skip to content

Commit d38de55

Browse files
committed
add reset_index in process_dataframe after sorting by chain,pos,atom to avoid ambiguous / unexpected indexing using .loc
1 parent 46b935b commit d38de55

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

graphein/protein/graphs.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,8 +456,9 @@ def process_dataframe(
456456

457457
log.debug(f"Detected {len(protein_df)} total nodes")
458458

459-
# Sort dataframe to place HETATMs
459+
# Sort dataframe to place HETATMs and reset index
460460
protein_df = sort_dataframe(protein_df)
461+
protein_df = protein_df.reset_index(drop=True)
461462

462463
return protein_df
463464

0 commit comments

Comments
 (0)