Skip to content

Commit

Permalink
Filter out non-numeric values in 'jumpedFrom' column before conversio…
Browse files Browse the repository at this point in the history
…n for data integrity
  • Loading branch information
petya-vasileva committed Jan 26, 2025
1 parent 382ad01 commit 08c8049
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/pages/explore_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ def load_initial_data(selected_keys, changeDf):
if event in frames.keys():
dataTables.append(generate_tables(frames[event], pivotFrames[event], event, alarmsInst))

# Filter out non-numeric values before conversion
changeDf = changeDf[pd.to_numeric(changeDf['jumpedFrom'], errors='coerce').notnull()]
changeDf['jumpedFrom'] = changeDf['jumpedFrom'].fillna(0).astype(int)
changeDf['diff'] = changeDf['diff'].astype(int)

Expand Down

0 comments on commit 08c8049

Please sign in to comment.