diff --git a/pandas/core/generic.py b/pandas/core/generic.py index ac01ffcdba6ce..3a48cc8a66076 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -3885,7 +3885,7 @@ def to_csv( Format floats using scientific notation: - >>> df.to_csv("out2.csv", float_format="{:.2e}".format) # doctest: +SKIP + >>> df.to_csv("out2.csv", float_format="{{:.2e}}".format) # doctest: +SKIP """ df = self if isinstance(self, ABCDataFrame) else self.to_frame()