WaysAhead Global commited on
Commit
bba55c0
Β·
verified Β·
1 Parent(s): c907259

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -39,12 +39,15 @@ competitor_files = {
39
  # βœ… Load KPI Data
40
  df_kpi = pd.read_excel(kpi_file, engine="openpyxl")
41
 
42
- # βœ… Load Competitor Data
43
  df_competitors = {}
44
  for mall, file_name in competitor_files.items():
45
  file_path = os.path.join(repo_path, file_name)
46
  if os.path.exists(file_path):
47
- df_competitors[mall] = pd.read_csv(file_path, encoding="utf-8", on_bad_lines="skip")
 
 
 
48
 
49
  # βœ… Display Previews
50
  st.subheader("πŸ“Š KPI Data Preview (5 Unique Rows)")
 
39
  # βœ… Load KPI Data
40
  df_kpi = pd.read_excel(kpi_file, engine="openpyxl")
41
 
42
+ # βœ… Load Competitor Data with ISO Encoding
43
  df_competitors = {}
44
  for mall, file_name in competitor_files.items():
45
  file_path = os.path.join(repo_path, file_name)
46
  if os.path.exists(file_path):
47
+ try:
48
+ df_competitors[mall] = pd.read_csv(file_path, encoding="ISO-8859-1", on_bad_lines="skip")
49
+ except Exception as e:
50
+ st.error(f"❌ Error loading {file_name}: {e}")
51
 
52
  # βœ… Display Previews
53
  st.subheader("πŸ“Š KPI Data Preview (5 Unique Rows)")