Update app.py
Browse files
app.py
CHANGED
|
@@ -129,7 +129,16 @@ def load_local_files():
|
|
| 129 |
df = pd.read_excel(file)
|
| 130 |
rows = []
|
| 131 |
for index, row in df.iterrows():
|
| 132 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 133 |
content = "\n\n".join(rows)
|
| 134 |
else:
|
| 135 |
content = pd.read_excel(file).to_string()
|
|
|
|
| 129 |
df = pd.read_excel(file)
|
| 130 |
rows = []
|
| 131 |
for index, row in df.iterrows():
|
| 132 |
+
# Start with the required fields
|
| 133 |
+
row_text = f"Fråga: {row['Fråga']}\nSvar: {row['Svar']}"
|
| 134 |
+
|
| 135 |
+
# Add kategori if it exists in the dataframe
|
| 136 |
+
if 'kategori' in df.columns:
|
| 137 |
+
row_text += f"\nKategori: {row['kategori']}"
|
| 138 |
+
elif 'Kategori' in df.columns: # Also check for capitalized version
|
| 139 |
+
row_text += f"\nKategori: {row['Kategori']}"
|
| 140 |
+
|
| 141 |
+
rows.append(row_text)
|
| 142 |
content = "\n\n".join(rows)
|
| 143 |
else:
|
| 144 |
content = pd.read_excel(file).to_string()
|