Skip to content

Commit 206a547

Browse files
authored
CLN 2574 Replace old string formating (#32007)
1 parent 45d093d commit 206a547

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pandas/tests/frame/test_to_csv.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ def _make_frame(names=None):
687687
df.to_csv(path)
688688

689689
for i in [6, 7]:
690-
msg = "len of {i}, but only 5 lines in file".format(i=i)
690+
msg = f"len of {i}, but only 5 lines in file"
691691
with pytest.raises(ParserError, match=msg):
692692
read_csv(path, header=list(range(i)), index_col=0)
693693

@@ -744,7 +744,7 @@ def test_to_csv_withcommas(self):
744744

745745
def test_to_csv_mixed(self):
746746
def create_cols(name):
747-
return ["{name}{i:03d}".format(name=name, i=i) for i in range(5)]
747+
return [f"{name}{i:03d}" for i in range(5)]
748748

749749
df_float = DataFrame(
750750
np.random.randn(100, 5), dtype="float64", columns=create_cols("float")

0 commit comments

Comments
 (0)