@@ -3109,9 +3109,9 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
3109
3109
regex : bool or same types as `to_replace`, default False
3110
3110
Whether to interpret ``to_replace`` and/or ``value`` as regular
3111
3111
expressions. If this is ``True`` then ``to_replace`` *must* be a
3112
- string. Alternatively, this could be a regular expression or a list,
3113
- dict, or array of regular expressions in which case ``to_replace``
3114
- must be ``None``.
3112
+ string. Alternatively, this could be a regular expression or a
3113
+ list, dict, or array of regular expressions in which case
3114
+ ``to_replace`` must be ``None``.
3115
3115
method : string, optional, {'pad', 'ffill', 'bfill'}
3116
3116
The method to use when for replacement, when ``to_replace`` is a
3117
3117
``list``.
@@ -3128,13 +3128,15 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
3128
3128
Raises
3129
3129
------
3130
3130
AssertionError
3131
- * If ``regex`` is not a ``bool`` and ``to_replace`` is not ``None``.
3131
+ * If ``regex`` is not a ``bool`` and ``to_replace`` is not
3132
+ ``None``.
3132
3133
TypeError
3133
3134
* If ``to_replace`` is a ``dict`` and `value` is not a ``list``,
3134
3135
``dict``, ``ndarray``, or ``Series``
3135
- * If ``to_replace`` is ``None`` and ``regex`` is not compilable into a
3136
- regular expression or is a list, dict, ndarray, or Series.
3137
- * When replacing multiple ``bool`` or ``datetime64`` objects and the
3136
+ * If ``to_replace`` is ``None`` and ``regex`` is not compilable
3137
+ into a regular expression or is a list, dict, ndarray, or
3138
+ Series.
3139
+ * When replacing multiple ``bool`` or ``datetime64`` objects and
3138
3140
the arguments to `to_replace` does not match the type of the
3139
3141
value being replaced
3140
3142
ValueError
@@ -3148,8 +3150,8 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
3148
3150
* Regular expressions will only substitute on strings, meaning you
3149
3151
cannot provide, for example, a regular expression matching floating
3150
3152
point numbers and expect the columns in your frame that have a
3151
- numeric dtype to be matched. However, if those floating point numbers
3152
- *are* strings, then you can do this.
3153
+ numeric dtype to be matched. However, if those floating point
3154
+ numbers *are* strings, then you can do this.
3153
3155
* This method has *a lot* of options. You are encouraged to experiment
3154
3156
and play with this method to gain intuition about how it works.
3155
3157
@@ -3246,8 +3248,9 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
3246
3248
3247
3249
"""
3248
3250
return super (DataFrame , self ).replace (to_replace = to_replace ,
3249
- value = value , inplace = inplace , limit = limit , regex = regex ,
3250
- method = method , axis = axis )
3251
+ value = value , inplace = inplace ,
3252
+ limit = limit , regex = regex ,
3253
+ method = method , axis = axis )
3251
3254
3252
3255
@Appender (_shared_docs ['shift' ] % _shared_doc_kwargs )
3253
3256
def shift (self , periods = 1 , freq = None , axis = 0 ):
0 commit comments