Spaces:
Paused
Paused
WaysAhead Global commited on
Update app.py
Browse files
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 |
-
|
|
|
|
|
|
|
|
|
|
| 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)")
|