Skip to content

Commit 2591055

Browse files
committed
fixed a linting error and docstrings validation
1 parent b135343 commit 2591055

File tree

3 files changed

+30
-25
lines changed

3 files changed

+30
-25
lines changed

pandas/core/frame.py

+14-11
Original file line numberDiff line numberDiff line change
@@ -2095,17 +2095,20 @@ def to_feather(self, path, **kwargs) -> None:
20952095
@doc(
20962096
Series.to_markdown,
20972097
klass=_shared_doc_kwargs["klass"],
2098-
examples="""Examples
2099-
--------
2100-
>>> df = pd.DataFrame(
2101-
... data={"animal_1": ["elk", "pig"], "animal_2": ["dog", "quetzal"]}
2102-
... )
2103-
>>> print(df.to_markdown())
2104-
| | animal_1 | animal_2 |
2105-
|---:|:-----------|:-----------|
2106-
| 0 | elk | dog |
2107-
| 1 | pig | quetzal |
2108-
""",
2098+
examples=dedent(
2099+
"""
2100+
Examples
2101+
--------
2102+
>>> df = pd.DataFrame(
2103+
... data={"animal_1": ["elk", "pig"], "animal_2": ["dog", "quetzal"]}
2104+
... )
2105+
>>> print(df.to_markdown())
2106+
| | animal_1 | animal_2 |
2107+
|---:|:-----------|:-----------|
2108+
| 0 | elk | dog |
2109+
| 1 | pig | quetzal |
2110+
"""
2111+
),
21092112
)
21102113
def to_markdown(
21112114
self, buf: Optional[IO[str]] = None, mode: Optional[str] = None, **kwargs

pandas/core/internals/blocks.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
from pandas._libs import NaT, algos as libalgos, lib, writers
1010
import pandas._libs.internals as libinternals
11-
from pandas._libs.tslibs import Timedelta, conversion
11+
from pandas._libs.tslibs import conversion
1212
from pandas._libs.tslibs.timezones import tz_compare
1313
from pandas._typing import ArrayLike
1414
from pandas.util._validators import validate_bool_kwarg

pandas/core/series.py

+15-13
Original file line numberDiff line numberDiff line change
@@ -1427,17 +1427,20 @@ def to_string(
14271427

14281428
@doc(
14291429
klass=_shared_doc_kwargs["klass"],
1430-
examples="""Examples
1431-
--------
1432-
>>> s = pd.Series(["elk", "pig", "dog", "quetzal"], name="animal")
1433-
>>> print(s.to_markdown())
1434-
| | animal |
1435-
|---:|:---------|
1436-
| 0 | elk |
1437-
| 1 | pig |
1438-
| 2 | dog |
1439-
| 3 | quetzal |
1440-
""",
1430+
examples=dedent(
1431+
"""
1432+
Examples
1433+
--------
1434+
>>> s = pd.Series(["elk", "pig", "dog", "quetzal"], name="animal")
1435+
>>> print(s.to_markdown())
1436+
| | animal |
1437+
|---:|:---------|
1438+
| 0 | elk |
1439+
| 1 | pig |
1440+
| 2 | dog |
1441+
| 3 | quetzal |
1442+
"""
1443+
),
14411444
)
14421445
def to_markdown(
14431446
self, buf: Optional[IO[str]] = None, mode: Optional[str] = None, **kwargs
@@ -1460,8 +1463,7 @@ def to_markdown(
14601463
-------
14611464
str
14621465
{klass} in Markdown-friendly format.
1463-
{examples}
1464-
"""
1466+
{examples}"""
14651467
return self.to_frame().to_markdown(buf, mode, **kwargs)
14661468

14671469
# ----------------------------------------------------------------------

0 commit comments

Comments
 (0)