Skip to content

Commit 710922e

Browse files
committed
update to DataFrame.map()
1 parent 4c0332d commit 710922e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

upload_to_sheets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def read_csv(file_path):
4343
# Replace NaN values with empty strings
4444
df = df.fillna('')
4545
# Convert all values to strings and strip whitespace
46-
df = df.applymap(lambda x: str(x).strip() if isinstance(x, str) else x)
46+
df = df.astype(str).apply(lambda x: x.str.strip())
4747
return [df.columns.tolist()] + df.values.tolist()
4848
except FileNotFoundError:
4949
print(f"Error: CSV file not found at {file_path}")

0 commit comments

Comments
 (0)