Skip to content

Commit b33d42f

Browse files
author
Thierry Moisan
committed
Add return type and indent example of DataFrame.to_csv docstring.
1 parent b939239 commit b33d42f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pandas/core/generic.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9438,8 +9438,9 @@ def to_csv(self, path_or_buf=None, sep=",", na_rep='', float_format=None,
94389438
94399439
Returns
94409440
-------
9441-
If path_or_buf is None, returns the resulting csv format as a string.
9442-
Otherwise returns None.
9441+
None or str
9442+
If path_or_buf is None, returns the resulting csv format as a
9443+
string. Otherwise returns None.
94439444
94449445
See Also
94459446
--------
@@ -9449,7 +9450,8 @@ def to_csv(self, path_or_buf=None, sep=",", na_rep='', float_format=None,
94499450
Examples
94509451
--------
94519452
>>> df = pd.DataFrame({'name': ['Raphael', 'Donatello'],
9452-
... 'mask': ['red', 'purple'], 'weapon': ['sai', 'bo staff']})
9453+
... 'mask': ['red', 'purple'],
9454+
... 'weapon': ['sai', 'bo staff']})
94539455
>>> df.to_csv(index=False)
94549456
'name,mask,weapon\nRaphael,red,sai\nDonatello,purple,bo staff\n'
94559457
"""

0 commit comments

Comments
 (0)