Skip to content

Commit

Permalink
DOC: fix DataFrame.replace and DataFrame.set_index (pandas-dev#23939)
Browse files Browse the repository at this point in the history
  • Loading branch information
Moisan authored and Pingviinituutti committed Feb 28, 2019
1 parent b37e6f4 commit 3a6991c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 8 additions & 8 deletions pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3a6991c

Please sign in to comment.