@@ -3139,9 +3139,9 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
3139
3139
regex : bool or same types as `to_replace`, default False
3140
3140
Whether to interpret ``to_replace`` and/or ``value`` as regular
3141
3141
expressions. If this is ``True`` then ``to_replace`` *must* be a
3142
- string. Alternatively, this could be a regular expression or a list,
3143
- dict, or array of regular expressions in which case ``to_replace``
3144
- must be ``None``.
3142
+ string. Alternatively, this could be a regular expression or a
3143
+ list, dict, or array of regular expressions in which case
3144
+ ``to_replace`` must be ``None``.
3145
3145
method : string, optional, {'pad', 'ffill', 'bfill'}
3146
3146
The method to use when for replacement, when ``to_replace`` is a
3147
3147
``list``.
@@ -3158,13 +3158,15 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
3158
3158
Raises
3159
3159
------
3160
3160
AssertionError
3161
- * If ``regex`` is not a ``bool`` and ``to_replace`` is not ``None``.
3161
+ * If ``regex`` is not a ``bool`` and ``to_replace`` is not
3162
+ ``None``.
3162
3163
TypeError
3163
3164
* If ``to_replace`` is a ``dict`` and `value` is not a ``list``,
3164
3165
``dict``, ``ndarray``, or ``Series``
3165
- * If ``to_replace`` is ``None`` and ``regex`` is not compilable into a
3166
- regular expression or is a list, dict, ndarray, or Series.
3167
- * When replacing multiple ``bool`` or ``datetime64`` objects and the
3166
+ * If ``to_replace`` is ``None`` and ``regex`` is not compilable
3167
+ into a regular expression or is a list, dict, ndarray, or
3168
+ Series.
3169
+ * When replacing multiple ``bool`` or ``datetime64`` objects and
3168
3170
the arguments to `to_replace` does not match the type of the
3169
3171
value being replaced
3170
3172
ValueError
@@ -3178,8 +3180,8 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
3178
3180
* Regular expressions will only substitute on strings, meaning you
3179
3181
cannot provide, for example, a regular expression matching floating
3180
3182
point numbers and expect the columns in your frame that have a
3181
- numeric dtype to be matched. However, if those floating point numbers
3182
- *are* strings, then you can do this.
3183
+ numeric dtype to be matched. However, if those floating point
3184
+ numbers *are* strings, then you can do this.
3183
3185
* This method has *a lot* of options. You are encouraged to experiment
3184
3186
and play with this method to gain intuition about how it works.
3185
3187
@@ -3276,8 +3278,9 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
3276
3278
3277
3279
"""
3278
3280
return super (DataFrame , self ).replace (to_replace = to_replace ,
3279
- value = value , inplace = inplace , limit = limit , regex = regex ,
3280
- method = method , axis = axis )
3281
+ value = value , inplace = inplace ,
3282
+ limit = limit , regex = regex ,
3283
+ method = method , axis = axis )
3281
3284
3282
3285
@Appender (_shared_docs ['shift' ] % _shared_doc_kwargs )
3283
3286
def shift (self , periods = 1 , freq = None , axis = 0 ):
0 commit comments