DavMelchi commited on
Commit
d22f665
·
1 Parent(s): 9f2ddd2

fix infinite coordinates errors

Browse files
Files changed (1) hide show
  1. process_kpi/process_gsm_capacity.py +13 -3
process_kpi/process_gsm_capacity.py CHANGED
@@ -506,6 +506,9 @@ def get_operational_neighbours(distance: int) -> pd.DataFrame:
506
  operational_df = operational_df[
507
  operational_df["operational_comment"] != "Operational is OK"
508
  ]
 
 
 
509
 
510
  # Rename all columns in operational_df by adding "Dataset2_" prefix
511
  operational_df = operational_df.add_prefix("Dataset2_")
@@ -515,12 +518,19 @@ def get_operational_neighbours(distance: int) -> pd.DataFrame:
515
  ["ID_BTS", "name", "BH Congestion status", "Longitude", "Latitude"]
516
  ]
517
 
518
- # Remove NaN , empty string
519
- congested_df = congested_df[congested_df["BH Congestion status"] != ""]
520
-
 
 
521
  # Remove rows where "BH Congestion status" is "nan, nan"
522
  congested_df = congested_df[congested_df["BH Congestion status"] != "nan, nan"]
523
 
 
 
 
 
 
524
  # Rename all columns in congested_df by adding "Dataset1_" prefix
525
  congested_df = congested_df.add_prefix("Dataset1_")
526
 
 
506
  operational_df = operational_df[
507
  operational_df["operational_comment"] != "Operational is OK"
508
  ]
509
+ operational_df = operational_df[
510
+ operational_df[["Latitude", "Longitude"]].notna().all(axis=1)
511
+ ]
512
 
513
  # Rename all columns in operational_df by adding "Dataset2_" prefix
514
  operational_df = operational_df.add_prefix("Dataset2_")
 
518
  ["ID_BTS", "name", "BH Congestion status", "Longitude", "Latitude"]
519
  ]
520
 
521
+ # Remove rows where "BH Congestion status" is empty or NaN
522
+ congested_df = congested_df[
523
+ congested_df["BH Congestion status"].notna()
524
+ & congested_df["BH Congestion status"].astype(str).str.len().astype(bool)
525
+ ]
526
  # Remove rows where "BH Congestion status" is "nan, nan"
527
  congested_df = congested_df[congested_df["BH Congestion status"] != "nan, nan"]
528
 
529
+ # Remove rows where Latitude and Longitude are empty
530
+ congested_df = congested_df[
531
+ congested_df[["Latitude", "Longitude"]].notna().all(axis=1)
532
+ ]
533
+
534
  # Rename all columns in congested_df by adding "Dataset1_" prefix
535
  congested_df = congested_df.add_prefix("Dataset1_")
536