Wajahat698 commited on
Commit
81855e2
·
verified ·
1 Parent(s): 49b535b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -12
app.py CHANGED
@@ -448,6 +448,8 @@ def analyze_excel_single(file_path):
448
  if loyalty_missing_ratio > 0.8:
449
  df.drop(columns=["Loyalty"], inplace=True)
450
  loyalty_present = False
 
 
451
 
452
  # Handling Consideration column
453
  consideration_present = "Consideration" in df.columns
@@ -456,6 +458,8 @@ def analyze_excel_single(file_path):
456
  if consideration_missing_ratio > 0.8:
457
  df.drop(columns=["Consideration"], inplace=True)
458
  consideration_present = False
 
 
459
 
460
  # Handling Satisfaction column
461
  satisfaction_present = "Satisfaction" in df.columns
@@ -464,6 +468,8 @@ def analyze_excel_single(file_path):
464
  if satisfaction_missing_ratio > 0.8:
465
  df.drop(columns=["Satisfaction"], inplace=True)
466
  satisfaction_present = False
 
 
467
 
468
  # Step 2: Remove missing values and print data shape
469
  df.dropna(subset=required_columns, inplace=True)
@@ -728,27 +734,30 @@ def analyze_excel_single(file_path):
728
 
729
  if img_nps is None:
730
  # Load the placeholder image if NPS analysis was not performed
731
- img_nps = Image.open("./images/nps_not_available.png")
732
- img_nps = img_nps.resize((1000, 800), Image.Resampling.LANCZOS)
 
733
 
734
  if img_loyalty is None:
735
  # Load the placeholder image if Loyalty analysis was not performed
736
- img_loyalty = Image.open("./images/loyalty_not_available.png")
737
- img_loyalty = img_loyalty.resize((1000, 800), Image.Resampling.LANCZOS)
 
738
 
739
  if img_consideration is None:
740
  # Load the placeholder image if Consideration analysis was not performed
741
- img_consideration = Image.open("./images/consideration_not_available.png")
742
- img_consideration = img_consideration.resize(
743
- (1000, 800), Image.Resampling.LANCZOS
744
- )
 
745
 
746
  if img_satisfaction is None:
747
  # Load the placeholder image if Satisfaction analysis was not performed
748
- img_satisfaction = Image.open("./images/satisfaction_not_available.png")
749
- img_satisfaction = img_satisfaction.resize(
750
- (1000, 800), Image.Resampling.LANCZOS
751
- )
752
 
753
  return (
754
  img_bucketfull,
 
448
  if loyalty_missing_ratio > 0.8:
449
  df.drop(columns=["Loyalty"], inplace=True)
450
  loyalty_present = False
451
+ else:
452
+ print("not present")
453
 
454
  # Handling Consideration column
455
  consideration_present = "Consideration" in df.columns
 
458
  if consideration_missing_ratio > 0.8:
459
  df.drop(columns=["Consideration"], inplace=True)
460
  consideration_present = False
461
+ else:
462
+ print("not present")
463
 
464
  # Handling Satisfaction column
465
  satisfaction_present = "Satisfaction" in df.columns
 
468
  if satisfaction_missing_ratio > 0.8:
469
  df.drop(columns=["Satisfaction"], inplace=True)
470
  satisfaction_present = False
471
+ else:
472
+ print("not present")
473
 
474
  # Step 2: Remove missing values and print data shape
475
  df.dropna(subset=required_columns, inplace=True)
 
734
 
735
  if img_nps is None:
736
  # Load the placeholder image if NPS analysis was not performed
737
+ #img_nps = Image.open("./images/nps_not_available.png")
738
+ #img_nps = img_nps.resize((1000, 800), Image.Resampling.LANCZOS)
739
+ print("none")
740
 
741
  if img_loyalty is None:
742
  # Load the placeholder image if Loyalty analysis was not performed
743
+ #img_loyalty = Image.open("./images/loyalty_not_available.png")
744
+ #img_loyalty = img_loyalty.resize((1000, 800), Image.Resampling.LANCZOS)
745
+ print("none")
746
 
747
  if img_consideration is None:
748
  # Load the placeholder image if Consideration analysis was not performed
749
+ #img_consideration = Image.open("./images/consideration_not_available.png")
750
+ #img_consideration = img_consideration.resize(
751
+ # (1000, 800), Image.Resampling.LANCZOS
752
+ #)
753
+ print("none")
754
 
755
  if img_satisfaction is None:
756
  # Load the placeholder image if Satisfaction analysis was not performed
757
+ #img_satisfaction = Image.open("./images/satisfaction_not_available.png")
758
+ #img_satisfaction = img_satisfaction.resize(
759
+ # (1000, 800), Image.Resampling.LANCZOS
760
+ #)
761
 
762
  return (
763
  img_bucketfull,