From fe95c44054bc270fe30091286076a62ef13efbb6 Mon Sep 17 00:00:00 2001 From: petya-vasileva Date: Tue, 15 Oct 2024 08:44:54 +0000 Subject: [PATCH] Fix the NA/null values --- ps-trace_path_changed.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ps-trace_path_changed.py b/ps-trace_path_changed.py index 62e1be8..b257e3c 100644 --- a/ps-trace_path_changed.py +++ b/ps-trace_path_changed.py @@ -755,7 +755,14 @@ def sendAlarms(data): # Get the probability for each position, based on src-dest pair probDf = getProbabilities(posDf, max_ttl) -probDf[~(probDf['asn'].isna()) & ~(probDf['asn']=='')] + +# Replace empty strings with NaN first +probDf['asn'].replace('', np.nan, inplace=True) +# Remove rows where 'asn' is NaN (including inf if needed) +probDf = probDf[~probDf['asn'].isna()] + +print(f"Python version: {sys.version}") +print(f"Pandas version: {pd.__version__}") # Find the nodes that work sporadically and add those the the baseline list