We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4b76b82 commit 284b47bCopy full SHA for 284b47b
1 file changed
styleframe/style_frame.py
@@ -549,8 +549,12 @@ def get_range_of_cells(row_index=None, columns=None):
549
if best_fit:
550
if not isinstance(best_fit, (list, set, tuple)):
551
best_fit = [best_fit]
552
- self.set_column_width_dict({column: (max(self.data_df[column].astype(str).str.len()) + self.A_FACTOR) * self.P_FACTOR
553
- for column in best_fit})
+ self.set_column_width_dict(
+ {
554
+ column: (max(self.data_df[column].astype(str).str.len(), default=0) + self.A_FACTOR) * self.P_FACTOR
555
+ for column in best_fit
556
+ }
557
+ )
558
559
for column in self._columns_width:
560
column_letter = self._get_column_as_letter(sheet, column, startcol)
0 commit comments