Skip to content

Commit

Permalink
Updating implementation based on reviewer feedback.
Browse files Browse the repository at this point in the history
  • Loading branch information
rmhowe425 committed Feb 18, 2024
1 parent cd4ac01 commit 43d8a0e
Showing 1 changed file with 31 additions and 31 deletions.
62 changes: 31 additions & 31 deletions pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -1606,37 +1606,6 @@ def to_string(
f.write(result)
return None

@doc(
klass=_shared_doc_kwargs["klass"],
storage_options=_shared_docs["storage_options"],
examples=dedent(
"""Examples
--------
>>> s = pd.Series(["elk", "pig", "dog", "quetzal"], name="animal")
>>> print(s.to_markdown())
| | animal |
|---:|:---------|
| 0 | elk |
| 1 | pig |
| 2 | dog |
| 3 | quetzal |
Output markdown with a tabulate option.
>>> print(s.to_markdown(tablefmt="grid"))
+----+----------+
| | animal |
+====+==========+
| 0 | elk |
+----+----------+
| 1 | pig |
+----+----------+
| 2 | dog |
+----+----------+
| 3 | quetzal |
+----+----------+"""
),
)
@overload
def to_markdown(
self,
Expand Down Expand Up @@ -1673,6 +1642,37 @@ def to_markdown(
) -> str | None:
...

@doc(
klass=_shared_doc_kwargs["klass"],
storage_options=_shared_docs["storage_options"],
examples=dedent(
"""Examples
--------
>>> s = pd.Series(["elk", "pig", "dog", "quetzal"], name="animal")
>>> print(s.to_markdown())
| | animal |
|---:|:---------|
| 0 | elk |
| 1 | pig |
| 2 | dog |
| 3 | quetzal |
Output markdown with a tabulate option.
>>> print(s.to_markdown(tablefmt="grid"))
+----+----------+
| | animal |
+====+==========+
| 0 | elk |
+----+----------+
| 1 | pig |
+----+----------+
| 2 | dog |
+----+----------+
| 3 | quetzal |
+----+----------+"""
),
)
@deprecate_nonkeyword_arguments(
version="3.0.0", allowed_args=["self", "buf"], name="to_markdown"
)
Expand Down

0 comments on commit 43d8a0e

Please sign in to comment.