Skip to content

Commit 4d44909

Browse files
authored
Improve document for **kwargs argument of pandas.DataFrame.to_markdown (#34594)
1 parent 5f74d8a commit 4d44909

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

pandas/core/frame.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2195,6 +2195,17 @@ def to_feather(self, path, **kwargs) -> None:
21952195
|---:|:-----------|:-----------|
21962196
| 0 | elk | dog |
21972197
| 1 | pig | quetzal |
2198+
2199+
Output markdown with a tabulate option.
2200+
2201+
>>> print(df.to_markdown(tablefmt="grid"))
2202+
+----+------------+------------+
2203+
| | animal_1 | animal_2 |
2204+
+====+============+============+
2205+
| 0 | elk | dog |
2206+
+----+------------+------------+
2207+
| 1 | pig | quetzal |
2208+
+----+------------+------------+
21982209
"""
21992210
)
22002211
@Substitution(klass="DataFrame")

pandas/core/generic.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1917,7 +1917,8 @@ def _repr_data_resource_(self):
19171917
mode : str, optional
19181918
Mode in which file is opened.
19191919
**kwargs
1920-
These parameters will be passed to `tabulate`.
1920+
These parameters will be passed to `tabulate \
1921+
<https://pypi.org/project/tabulate>`_.
19211922
19221923
Returns
19231924
-------

0 commit comments

Comments
 (0)