@@ -91,6 +91,7 @@ def build_xlstyle(self, props):
91
91
"font" : self .build_font (props ),
92
92
"number_format" : self .build_number_format (props ),
93
93
}
94
+
94
95
# TODO: handle cell width and height: needs support in pandas.io.excel
95
96
96
97
def remove_none (d ):
@@ -132,12 +133,10 @@ def build_border(self, props):
132
133
return {
133
134
side : {
134
135
"style" : self ._border_style (
135
- props .get ("border-{side}-style" .format (side = side )),
136
- props .get ("border-{side}-width" .format (side = side )),
137
- ),
138
- "color" : self .color_to_excel (
139
- props .get ("border-{side}-color" .format (side = side ))
136
+ props .get (f"border-{ side } -style" ),
137
+ props .get (f"border-{ side } -width" ),
140
138
),
139
+ "color" : self .color_to_excel (props .get (f"border-{ side } -color" )),
141
140
}
142
141
for side in ["top" , "right" , "bottom" , "left" ]
143
142
}
@@ -427,7 +426,7 @@ def _format_value(self, val):
427
426
if missing .isposinf_scalar (val ):
428
427
val = self .inf_rep
429
428
elif missing .isneginf_scalar (val ):
430
- val = "-{inf}" . format ( inf = self .inf_rep )
429
+ val = f "-{ self .inf_rep } "
431
430
elif self .float_format is not None :
432
431
val = float (self .float_format % val )
433
432
if getattr (val , "tzinfo" , None ) is not None :
@@ -509,8 +508,8 @@ def _format_header_regular(self):
509
508
if has_aliases :
510
509
if len (self .header ) != len (self .columns ):
511
510
raise ValueError (
512
- "Writing {cols } cols but got {alias } "
513
- "aliases" . format ( cols = len ( self . columns ), alias = len ( self . header ))
511
+ f "Writing { len ( self . columns ) } cols but got { len ( self . header ) } "
512
+ "aliases"
514
513
)
515
514
else :
516
515
colnames = self .header
@@ -718,8 +717,8 @@ def write(
718
717
if num_rows > self .max_rows or num_cols > self .max_cols :
719
718
raise ValueError (
720
719
"This sheet is too large! Your sheet size is: "
721
- + "{ }, {} ". format ( num_rows , num_cols )
722
- + "Max sheet size is: {}, {}" . format ( self .max_rows , self .max_cols )
720
+ f" { num_rows } , { num_cols } "
721
+ f "Max sheet size is: { self .max_rows } , { self .max_cols } "
723
722
)
724
723
725
724
if isinstance (writer , ExcelWriter ):
0 commit comments