@@ -3156,9 +3156,9 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
3156
3156
regex : bool or same types as `to_replace`, default False
3157
3157
Whether to interpret ``to_replace`` and/or ``value`` as regular
3158
3158
expressions. If this is ``True`` then ``to_replace`` *must* be a
3159
- string. Alternatively, this could be a regular expression or a list,
3160
- dict, or array of regular expressions in which case ``to_replace``
3161
- must be ``None``.
3159
+ string. Alternatively, this could be a regular expression or a
3160
+ list, dict, or array of regular expressions in which case
3161
+ ``to_replace`` must be ``None``.
3162
3162
method : string, optional, {'pad', 'ffill', 'bfill'}
3163
3163
The method to use when for replacement, when ``to_replace`` is a
3164
3164
``list``.
@@ -3175,13 +3175,15 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
3175
3175
Raises
3176
3176
------
3177
3177
AssertionError
3178
- * If ``regex`` is not a ``bool`` and ``to_replace`` is not ``None``.
3178
+ * If ``regex`` is not a ``bool`` and ``to_replace`` is not
3179
+ ``None``.
3179
3180
TypeError
3180
3181
* If ``to_replace`` is a ``dict`` and `value` is not a ``list``,
3181
3182
``dict``, ``ndarray``, or ``Series``
3182
- * If ``to_replace`` is ``None`` and ``regex`` is not compilable into a
3183
- regular expression or is a list, dict, ndarray, or Series.
3184
- * When replacing multiple ``bool`` or ``datetime64`` objects and the
3183
+ * If ``to_replace`` is ``None`` and ``regex`` is not compilable
3184
+ into a regular expression or is a list, dict, ndarray, or
3185
+ Series.
3186
+ * When replacing multiple ``bool`` or ``datetime64`` objects and
3185
3187
the arguments to `to_replace` does not match the type of the
3186
3188
value being replaced
3187
3189
ValueError
@@ -3195,8 +3197,8 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
3195
3197
* Regular expressions will only substitute on strings, meaning you
3196
3198
cannot provide, for example, a regular expression matching floating
3197
3199
point numbers and expect the columns in your frame that have a
3198
- numeric dtype to be matched. However, if those floating point numbers
3199
- *are* strings, then you can do this.
3200
+ numeric dtype to be matched. However, if those floating point
3201
+ numbers *are* strings, then you can do this.
3200
3202
* This method has *a lot* of options. You are encouraged to experiment
3201
3203
and play with this method to gain intuition about how it works.
3202
3204
@@ -3293,8 +3295,9 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
3293
3295
3294
3296
"""
3295
3297
return super (DataFrame , self ).replace (to_replace = to_replace ,
3296
- value = value , inplace = inplace , limit = limit , regex = regex ,
3297
- method = method , axis = axis )
3298
+ value = value , inplace = inplace ,
3299
+ limit = limit , regex = regex ,
3300
+ method = method , axis = axis )
3298
3301
3299
3302
@Appender (_shared_docs ['shift' ] % _shared_doc_kwargs )
3300
3303
def shift (self , periods = 1 , freq = None , axis = 0 ):
0 commit comments