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