File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -3879,11 +3879,13 @@ def to_csv(
3879
3879
>>> os.makedirs("folder/subfolder", exist_ok=True) # doctest: +SKIP
3880
3880
>>> df.to_csv("folder/subfolder/out.csv") # doctest: +SKIP
3881
3881
3882
- Format floating-point numbers using float_format:
3883
- - Format floats to two decimal places:
3884
- >>> df.to_csv("out1.csv", float_format="%.2f") # doctest: +SKIP
3885
- - Use scientific notation:
3886
- >>> df.to_csv("out2.csv", float_format="{:.2e}".format) # doctest: +SKIP
3882
+ Format floats to two decimal places:
3883
+
3884
+ >>> df.to_csv("out1.csv", float_format="%.2f") # doctest: +SKIP
3885
+
3886
+ Format floats using scientific notation:
3887
+
3888
+ >>> df.to_csv("out2.csv", float_format="{:.2e}".format) # doctest: +SKIP
3887
3889
"""
3888
3890
df = self if isinstance (self , ABCDataFrame ) else self .to_frame ()
3889
3891
You can’t perform that action at this time.
0 commit comments