@@ -330,7 +330,7 @@ def test_pie_series(self):
330
330
ax = _check_plot_works (
331
331
series .plot .pie , colors = color_args , autopct = "%.2f" , fontsize = 7
332
332
)
333
- pcts = ["{0 :.2f}". format ( s * 100 ) for s in series .values / float (series .sum ())]
333
+ pcts = [f" { s * 100 :.2f} " for s in series .values / float (series .sum ())]
334
334
expected_texts = list (chain .from_iterable (zip (series .index , pcts )))
335
335
self ._check_text_labels (ax .texts , expected_texts )
336
336
for t in ax .texts :
@@ -865,15 +865,15 @@ def test_time_series_plot_color_with_empty_kwargs(self):
865
865
866
866
def test_xticklabels (self ):
867
867
# GH11529
868
- s = Series (np .arange (10 ), index = ["P{i:02d}" . format ( i = i ) for i in range (10 )])
868
+ s = Series (np .arange (10 ), index = [f "P{ i :02d} " for i in range (10 )])
869
869
_ , ax = self .plt .subplots ()
870
870
ax = s .plot (xticks = [0 , 3 , 5 , 9 ], ax = ax )
871
- exp = ["P{i:02d}" . format ( i = i ) for i in [0 , 3 , 5 , 9 ]]
871
+ exp = [f "P{ i :02d} " for i in [0 , 3 , 5 , 9 ]]
872
872
self ._check_text_labels (ax .get_xticklabels (), exp )
873
873
874
874
def test_xtick_barPlot (self ):
875
875
# GH28172
876
- s = pd .Series (range (10 ), index = ["P{i:02d}" . format ( i = i ) for i in range (10 )])
876
+ s = pd .Series (range (10 ), index = [f "P{ i :02d} " for i in range (10 )])
877
877
ax = s .plot .bar (xticks = range (0 , 11 , 2 ))
878
878
exp = np .array (list (range (0 , 11 , 2 )))
879
879
tm .assert_numpy_array_equal (exp , ax .get_xticks ())
0 commit comments