Spaces:
Sleeping
Sleeping
Update utils.py
Browse files
utils.py
CHANGED
|
@@ -38,17 +38,15 @@ class CSVAnalyzer:
|
|
| 38 |
try:
|
| 39 |
context = "E-Mail-Informationen:\n\n"
|
| 40 |
|
| 41 |
-
#
|
| 42 |
-
|
| 43 |
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
context += f"
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
if 'Gebäude' in row:
|
| 51 |
-
context += f"Gebäude: {row['Gebäude']}\n"
|
| 52 |
context += "---\n"
|
| 53 |
|
| 54 |
return context.strip()
|
|
|
|
| 38 |
try:
|
| 39 |
context = "E-Mail-Informationen:\n\n"
|
| 40 |
|
| 41 |
+
# Convert DataFrame to string and handle missing values
|
| 42 |
+
df_str = df.fillna("Keine Angabe").astype(str)
|
| 43 |
|
| 44 |
+
# Process each row
|
| 45 |
+
for index in range(len(df_str)):
|
| 46 |
+
row = df_str.iloc[index]
|
| 47 |
+
context += f"E-Mail {index + 1}:\n"
|
| 48 |
+
for column in df_str.columns:
|
| 49 |
+
context += f"{column}: {row[column]}\n"
|
|
|
|
|
|
|
| 50 |
context += "---\n"
|
| 51 |
|
| 52 |
return context.strip()
|