diff --git a/pandas/io/formats/style_render.py b/pandas/io/formats/style_render.py index 5089d0489c49f..c0e00d6bd30a4 100644 --- a/pandas/io/formats/style_render.py +++ b/pandas/io/formats/style_render.py @@ -1125,7 +1125,8 @@ def format( >>> df = pd.DataFrame({"A": [1, 0, -1]}) >>> pseudo_css = "number-format: 0§[Red](0)§-§@;" - >>> df.style.applymap(lambda v: pseudo_css).to_excel("formatted_file.xlsx") + >>> filename = "formatted_file.xlsx" + >>> df.style.applymap(lambda v: pseudo_css).to_excel(filename) # doctest: +SKIP .. figure:: ../../_static/style/format_excel_css.png """