Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -62,8 +62,12 @@ class GANRiskAnalyzer:
|
|
62 |
|
63 |
# Risk Analysis
|
64 |
def analyze_financial_data(file):
|
65 |
-
|
66 |
-
|
|
|
|
|
|
|
|
|
67 |
|
68 |
# Check required columns
|
69 |
required_columns = ["Revenue", "Profit", "Loss", "Expenses", "Risk_Level"]
|
|
|
62 |
|
63 |
# Risk Analysis
|
64 |
def analyze_financial_data(file):
|
65 |
+
try:
|
66 |
+
# Attempt to read the CSV file
|
67 |
+
data = pd.read_csv(file, encoding="utf-8")
|
68 |
+
except UnicodeDecodeError:
|
69 |
+
# Fallback for files with non-UTF-8 encodings
|
70 |
+
data = pd.read_csv(file, encoding="ISO-8859-1")
|
71 |
|
72 |
# Check required columns
|
73 |
required_columns = ["Revenue", "Profit", "Loss", "Expenses", "Risk_Level"]
|