Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Commit
·
0112458
1
Parent(s):
075199c
added suggestions & tool tip
Browse files
images/{FireBirdTech (1).png → Auto-Analyst Banner neo.png}
RENAMED
File without changes
|
src/routes/session_routes.py
CHANGED
@@ -152,6 +152,8 @@ async def upload_excel(
|
|
152 |
try:
|
153 |
# Read each sheet
|
154 |
sheet_df = pd.read_excel(io.BytesIO(contents), sheet_name=sheet_name)
|
|
|
|
|
155 |
|
156 |
# Preprocessing steps
|
157 |
# 1. Drop empty rows and columns
|
@@ -308,6 +310,8 @@ async def upload_dataframe(
|
|
308 |
try:
|
309 |
csv_content = content.decode(encoding)
|
310 |
new_df = pd.read_csv(io.StringIO(csv_content))
|
|
|
|
|
311 |
logger.log_message(f"Successfully read CSV with encoding: {encoding}", level=logging.INFO)
|
312 |
break
|
313 |
except Exception as e:
|
|
|
152 |
try:
|
153 |
# Read each sheet
|
154 |
sheet_df = pd.read_excel(io.BytesIO(contents), sheet_name=sheet_name)
|
155 |
+
sheet_df.replace({np.nan: None, np.inf: None, -np.inf: None}, inplace=True)
|
156 |
+
|
157 |
|
158 |
# Preprocessing steps
|
159 |
# 1. Drop empty rows and columns
|
|
|
310 |
try:
|
311 |
csv_content = content.decode(encoding)
|
312 |
new_df = pd.read_csv(io.StringIO(csv_content))
|
313 |
+
new_df.replace({np.nan: None, np.inf: None, -np.inf: None}, inplace=True)
|
314 |
+
|
315 |
logger.log_message(f"Successfully read CSV with encoding: {encoding}", level=logging.INFO)
|
316 |
break
|
317 |
except Exception as e:
|