Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -103,9 +103,9 @@ def new_line(n=1):
|
|
| 103 |
st.cache_data()
|
| 104 |
def load_data(upd_file):
|
| 105 |
# Read CSV or Excel file
|
| 106 |
-
if
|
| 107 |
return pd.read_csv(file)
|
| 108 |
-
elif
|
| 109 |
return pd.read_excel(file)
|
| 110 |
else:
|
| 111 |
raise ValueError("Unsupported file format. Only CSV and Excel files are supported.")
|
|
|
|
| 103 |
st.cache_data()
|
| 104 |
def load_data(upd_file):
|
| 105 |
# Read CSV or Excel file
|
| 106 |
+
if upd_file.name.endswith('.csv'):
|
| 107 |
return pd.read_csv(file)
|
| 108 |
+
elif upd_file.name.endswith('.xlsx') or file.name.endswith('.xls'):
|
| 109 |
return pd.read_excel(file)
|
| 110 |
else:
|
| 111 |
raise ValueError("Unsupported file format. Only CSV and Excel files are supported.")
|