Skip to content

CLN 31942/replace appender with doc 3 #33277

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
4b684e8
a batch of Appender for doc substitutions
smartvinnetou Apr 3, 2020
2a792c2
fixed a doc string template
smartvinnetou Apr 4, 2020
5b79504
replace appender with doc
smartvinnetou Apr 4, 2020
bbb7291
replace appender with doc
smartvinnetou Apr 4, 2020
21eca36
lint fix
smartvinnetou Apr 4, 2020
ca0fde2
required replacements in Series.py plus a minor improvement
smartvinnetou Apr 4, 2020
0ce108a
doc string fixes
smartvinnetou Apr 4, 2020
625656f
lint fix
smartvinnetou Apr 4, 2020
5321bba
removed non-existent reference
smartvinnetou Apr 4, 2020
391d815
fixed doc strings
smartvinnetou Apr 4, 2020
3b91f3f
fixed doc strings
smartvinnetou Apr 4, 2020
265cd33
fixed doc strings
smartvinnetou Apr 4, 2020
5a6b434
fixed a doc string
smartvinnetou Apr 4, 2020
d4ed87c
fixed a doc string
smartvinnetou Apr 4, 2020
aac20a8
fixed a doc string
smartvinnetou Apr 4, 2020
f202b70
fixed 'Double line break found' error reported by the docstrings check
smartvinnetou Apr 9, 2020
ad82682
fixed a type
smartvinnetou Apr 10, 2020
112be7a
remove potential douncle lines in a docstring
smartvinnetou Apr 10, 2020
e5d9733
fixed linting
smartvinnetou Apr 10, 2020
85d0783
fixed a linting error and docstrings validation
smartvinnetou Apr 12, 2020
6e98613
added missing `doc()` decorators
smartvinnetou Apr 17, 2020
150b282
revert to Appender in dynamically generated functions
smartvinnetou Apr 18, 2020
708295e
removed trailing white spaces
smartvinnetou Apr 18, 2020
dc49bc4
put back section breaks
smartvinnetou Apr 18, 2020
8f51b9f
put back more deleted blank lines
smartvinnetou Apr 18, 2020
59bbf43
fixed linting
smartvinnetou May 2, 2020
35d3661
fixed a doc template
smartvinnetou May 2, 2020
2d50215
remove forgotten Appender after a rebase
smartvinnetou May 3, 2020
2a249f2
add back a change lost in rebase
smartvinnetou Jun 8, 2020
9346702
fixed a black complaint
smartvinnetou Jun 8, 2020
69f28b5
fixed a docstring formatting
smartvinnetou Jun 8, 2020
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
32 changes: 18 additions & 14 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -2183,9 +2183,10 @@ def to_feather(self, path, **kwargs) -> None:

to_feather(self, path, **kwargs)

@Appender(
"""
Examples
@doc(
Series.to_markdown,
klass=_shared_doc_kwargs["klass"],
examples="""Examples
--------
>>> df = pd.DataFrame(
... data={"animal_1": ["elk", "pig"], "animal_2": ["dog", "quetzal"]}
Expand All @@ -2206,10 +2207,8 @@ def to_feather(self, path, **kwargs) -> None:
+----+------------+------------+
| 1 | pig | quetzal |
+----+------------+------------+
"""
""",
)
@Substitution(klass="DataFrame")
@Appender(_shared_docs["to_markdown"])
def to_markdown(
self, buf: Optional[IO[str]] = None, mode: Optional[str] = None, **kwargs
) -> Optional[str]:
Expand Down Expand Up @@ -4758,20 +4757,20 @@ def _maybe_casted_values(index, labels=None):
# ----------------------------------------------------------------------
# Reindex-based selection methods

@Appender(_shared_docs["isna"] % _shared_doc_kwargs)
@doc(NDFrame.isna, klass=_shared_doc_kwargs["klass"])
def isna(self) -> "DataFrame":
result = self._constructor(self._data.isna(func=isna))
return result.__finalize__(self, method="isna")

@Appender(_shared_docs["isna"] % _shared_doc_kwargs)
@doc(NDFrame.isna, klass=_shared_doc_kwargs["klass"])
def isnull(self) -> "DataFrame":
return self.isna()

@Appender(_shared_docs["notna"] % _shared_doc_kwargs)
@doc(NDFrame.notna, klass=_shared_doc_kwargs["klass"])
def notna(self) -> "DataFrame":
return ~self.isna()

@Appender(_shared_docs["notna"] % _shared_doc_kwargs)
@doc(NDFrame.notna, klass=_shared_doc_kwargs["klass"])
def notnull(self) -> "DataFrame":
return ~self.isna()

Expand Down Expand Up @@ -7330,13 +7329,14 @@ def _gotitem(
"""
)

@Substitution(
@doc(
_shared_docs["aggregate"],
klass=_shared_doc_kwargs["klass"],
axis=_shared_doc_kwargs["axis"],
see_also=_agg_summary_and_see_also_doc,
examples=_agg_examples_doc,
versionadded="\n.. versionadded:: 0.20.0\n",
**_shared_doc_kwargs,
)
@Appender(_shared_docs["aggregate"])
def aggregate(self, func, axis=0, *args, **kwargs):
axis = self._get_axis_number(axis)

Expand Down Expand Up @@ -7364,7 +7364,11 @@ def _aggregate(self, arg, axis=0, *args, **kwargs):

agg = aggregate

@Appender(_shared_docs["transform"] % _shared_doc_kwargs)
@doc(
NDFrame.transform,
klass=_shared_doc_kwargs["klass"],
axis=_shared_doc_kwargs["axis"],
)
def transform(self, func, axis=0, *args, **kwargs) -> "DataFrame":
axis = self._get_axis_number(axis)
if axis == 1:
Expand Down
Loading