From 8ed347a25c34676399a46a4274c3dcf366f37ecf Mon Sep 17 00:00:00 2001 From: Thierry Moisan Date: Thu, 29 Nov 2018 08:55:30 -0500 Subject: [PATCH] DOC: fix DataFrame.replace and DataFrame.set_index (#23939) --- ci/code_checks.sh | 2 +- pandas/core/generic.py | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 45cb1708258d7..5d0356dc8be9c 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -147,7 +147,7 @@ if [[ -z "$CHECK" || "$CHECK" == "doctests" ]]; then MSG='Doctests frame.py' ; echo $MSG pytest -q --doctest-modules pandas/core/frame.py \ - -k"-axes -combine -itertuples -join -pivot_table -quantile -query -reindex -reindex_axis -replace -round -set_index -stack" + -k"-axes -combine -itertuples -join -pivot_table -quantile -query -reindex -reindex_axis -round" RET=$(($RET + $?)) ; echo $MSG "DONE" MSG='Doctests series.py' ; echo $MSG diff --git a/pandas/core/generic.py b/pandas/core/generic.py index f43b93f200db3..3c580d29dce8d 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -6118,7 +6118,7 @@ def bfill(self, axis=None, inplace=False, limit=None, downcast=None): value to use for each column (columns not in the dict will not be filled). Regular expressions, strings and lists or dicts of such objects are also allowed. - inplace : boolean, default False + inplace : bool, default False If True, in place. Note: this will modify any other views on this object (e.g. a column from a DataFrame). Returns the caller if this is True. @@ -6137,12 +6137,6 @@ def bfill(self, axis=None, inplace=False, limit=None, downcast=None): .. versionchanged:: 0.23.0 Added to DataFrame. - See Also - -------- - %(klass)s.fillna : Fill NA values. - %(klass)s.where : Replace values based on boolean condition. - Series.str.replace : Simple string replacement. - Returns ------- %(klass)s @@ -6166,6 +6160,12 @@ def bfill(self, axis=None, inplace=False, limit=None, downcast=None): * If a ``list`` or an ``ndarray`` is passed to `to_replace` and `value` but they are not the same length. + See Also + -------- + %(klass)s.fillna : Fill NA values. + %(klass)s.where : Replace values based on boolean condition. + Series.str.replace : Simple string replacement. + Notes ----- * Regex substitution is performed under the hood with ``re.sub``. The @@ -6280,7 +6280,7 @@ def bfill(self, axis=None, inplace=False, limit=None, downcast=None): 1 foo new 2 bait xyz - >>> df.replace(regex={r'^ba.$':'new', 'foo':'xyz'}) + >>> df.replace(regex={r'^ba.$': 'new', 'foo': 'xyz'}) A B 0 new abc 1 xyz new