Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pandas/util/_decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def wrapper(*args, **kwargs) -> Callable[..., Any]:
if alternative.__doc__:
if alternative.__doc__.count("\n") < 3:
raise AssertionError(doc_error_msg)
empty1, summary, empty2, doc = alternative.__doc__.split("\n", 3)
empty1, summary, empty2, doc_string = alternative.__doc__.split("\n", 3)
if empty1 or empty2 and not summary:
raise AssertionError(doc_error_msg)
wrapper.__doc__ = dedent(
Expand All @@ -87,7 +87,7 @@ def wrapper(*args, **kwargs) -> Callable[..., Any]:
.. deprecated:: {version}
{msg}

{dedent(doc)}"""
{dedent(doc_string)}"""
)
# error: Incompatible return value type (got "Callable[[VarArg(Any), KwArg(Any)],
# Callable[...,Any]]", expected "Callable[[F], F]")
Expand Down
10 changes: 7 additions & 3 deletions pandas/util/_doctools.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def _make_table(self, ax, df, title: str, height: float | None = None) -> None:
ax.axis("off")


if __name__ == "__main__":
def main() -> None:
import matplotlib.pyplot as plt

p = TablePlotter()
Expand All @@ -188,8 +188,12 @@ def _make_table(self, ax, df, title: str, height: float | None = None) -> None:
idx = pd.MultiIndex.from_tuples(
[(1, "A"), (1, "B"), (1, "C"), (2, "A"), (2, "B"), (2, "C")]
)
col = pd.MultiIndex.from_tuples([(1, "A"), (1, "B")])
column = pd.MultiIndex.from_tuples([(1, "A"), (1, "B")])
df3 = pd.DataFrame({"v1": [1, 2, 3, 4, 5, 6], "v2": [5, 6, 7, 8, 9, 10]}, index=idx)
df3.columns = col
df3.columns = column
p.plot(df3, df3, labels=["df3"])
plt.show()


if __name__ == "__main__":
main()