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