Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -64,11 +64,11 @@ class GANRiskAnalyzer:
|
|
64 |
def analyze_financial_data(file):
|
65 |
try:
|
66 |
# Read the uploaded CSV file
|
67 |
-
data = pd.read_csv(file.name, encoding="utf-8",
|
68 |
except UnicodeDecodeError:
|
69 |
# Fallback for non-UTF-8 encoding
|
70 |
try:
|
71 |
-
data = pd.read_csv(file.name, encoding="ISO-8859-1",
|
72 |
except Exception as e:
|
73 |
return {"error": f"Failed to read file: {str(e)}"}
|
74 |
except Exception as e:
|
|
|
64 |
def analyze_financial_data(file):
|
65 |
try:
|
66 |
# Read the uploaded CSV file
|
67 |
+
data = pd.read_csv(file.name, encoding="utf-8", on_bad_lines='skip')
|
68 |
except UnicodeDecodeError:
|
69 |
# Fallback for non-UTF-8 encoding
|
70 |
try:
|
71 |
+
data = pd.read_csv(file.name, encoding="ISO-8859-1", on_bad_lines='skip')
|
72 |
except Exception as e:
|
73 |
return {"error": f"Failed to read file: {str(e)}"}
|
74 |
except Exception as e:
|