Upload interface.py
Browse files- src/interface.py +1 -1
src/interface.py
CHANGED
|
@@ -425,7 +425,7 @@ class makeInterface:
|
|
| 425 |
# Step 6: Dynamically set column widths based on content
|
| 426 |
for idx, col in enumerate(dftosave.columns):
|
| 427 |
# Calculate the maximum length of the column content
|
| 428 |
-
max_length = dftosave[col].fillna('').astype(str).map(len).max()
|
| 429 |
max_length = max(max_length, len(str(col))) + 2 # Adding extra space
|
| 430 |
worksheet.set_column(idx, idx, max_length, data_format)
|
| 431 |
|
|
|
|
| 425 |
# Step 6: Dynamically set column widths based on content
|
| 426 |
for idx, col in enumerate(dftosave.columns):
|
| 427 |
# Calculate the maximum length of the column content
|
| 428 |
+
max_length = dftosave[col].astype(object).fillna('').astype(str).map(len).max()
|
| 429 |
max_length = max(max_length, len(str(col))) + 2 # Adding extra space
|
| 430 |
worksheet.set_column(idx, idx, max_length, data_format)
|
| 431 |
|