Skip to content

Commit 2b4cefc

Browse files
committed
fix some lint issues
1 parent 618c253 commit 2b4cefc

File tree

2 files changed

+25
-19
lines changed

2 files changed

+25
-19
lines changed

pandas/core/frame.py

+14-11
Original file line numberDiff line numberDiff line change
@@ -3109,9 +3109,9 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
31093109
regex : bool or same types as `to_replace`, default False
31103110
Whether to interpret ``to_replace`` and/or ``value`` as regular
31113111
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``.
31153115
method : string, optional, {'pad', 'ffill', 'bfill'}
31163116
The method to use when for replacement, when ``to_replace`` is a
31173117
``list``.
@@ -3128,13 +3128,15 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
31283128
Raises
31293129
------
31303130
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``.
31323133
TypeError
31333134
* If ``to_replace`` is a ``dict`` and `value` is not a ``list``,
31343135
``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
31383140
the arguments to `to_replace` does not match the type of the
31393141
value being replaced
31403142
ValueError
@@ -3148,8 +3150,8 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
31483150
* Regular expressions will only substitute on strings, meaning you
31493151
cannot provide, for example, a regular expression matching floating
31503152
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.
31533155
* This method has *a lot* of options. You are encouraged to experiment
31543156
and play with this method to gain intuition about how it works.
31553157
@@ -3246,8 +3248,9 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
32463248
32473249
"""
32483250
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)
32513254

32523255
@Appender(_shared_docs['shift'] % _shared_doc_kwargs)
32533256
def shift(self, periods=1, freq=None, axis=0):

pandas/core/series.py

+11-8
Original file line numberDiff line numberDiff line change
@@ -2767,9 +2767,9 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
27672767
regex : bool or same types as ``to_replace``, default False
27682768
Whether to interpret ``to_replace`` and/or ``value`` as regular
27692769
expressions. If this is ``True`` then ``to_replace`` *must* be a
2770-
string. Alternatively, this could be a regular expression or a list,
2771-
dict, or array of regular expressions in which case ``to_replace``
2772-
must be ``None``.
2770+
string. Alternatively, this could be a regular expression or a
2771+
list, dict, or array of regular expressions in which case
2772+
``to_replace`` must be ``None``.
27732773
method : string, optional, {'pad', 'ffill', 'bfill'}
27742774
The method to use when for replacement, when ``to_replace`` is a
27752775
``list``.
@@ -2786,13 +2786,15 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
27862786
Raises
27872787
------
27882788
AssertionError
2789-
* If ``regex`` is not a ``bool`` and ``to_replace`` is not ``None``.
2789+
* If ``regex`` is not a ``bool`` and ``to_replace`` is not
2790+
``None``.
27902791
TypeError
27912792
* If ``to_replace`` is a ``dict`` and ``value`` is not a ``list``,
27922793
``dict``, ``ndarray``, or ``Series``
2793-
* If ``to_replace`` is ``None`` and ``regex`` is not compilable into a
2794+
* If ``to_replace`` is ``None`` and ``regex`` is not compilable
2795+
into a
27942796
regular expression or is a list, dict, ndarray, or Series.
2795-
* When replacing multiple ``bool`` or ``datetime64`` objects and the
2797+
* When replacing multiple ``bool`` or ``datetime64`` objects and
27962798
the arguments to ``to_replace`` does not match the type of the
27972799
value being replaced
27982800
ValueError
@@ -2892,8 +2894,9 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
28922894
28932895
"""
28942896
return super(Series, self).replace(to_replace=to_replace, value=value,
2895-
inplace=inplace, limit=limit,
2896-
regex=regex, method=method, axis=axis)
2897+
inplace=inplace, limit=limit,
2898+
regex=regex, method=method,
2899+
axis=axis)
28972900

28982901
@Appender(generic._shared_docs['shift'] % _shared_doc_kwargs)
28992902
def shift(self, periods=1, freq=None, axis=0):

0 commit comments

Comments
 (0)