Skip to content

Commit 9254f5c

Browse files
committed
fix some lint issues
1 parent b021a78 commit 9254f5c

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
@@ -3111,9 +3111,9 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
31113111
regex : bool or same types as `to_replace`, default False
31123112
Whether to interpret ``to_replace`` and/or ``value`` as regular
31133113
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``.
31173117
method : string, optional, {'pad', 'ffill', 'bfill'}
31183118
The method to use when for replacement, when ``to_replace`` is a
31193119
``list``.
@@ -3130,13 +3130,15 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
31303130
Raises
31313131
------
31323132
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``.
31343135
TypeError
31353136
* If ``to_replace`` is a ``dict`` and `value` is not a ``list``,
31363137
``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
31403142
the arguments to `to_replace` does not match the type of the
31413143
value being replaced
31423144
ValueError
@@ -3150,8 +3152,8 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
31503152
* Regular expressions will only substitute on strings, meaning you
31513153
cannot provide, for example, a regular expression matching floating
31523154
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.
31553157
* This method has *a lot* of options. You are encouraged to experiment
31563158
and play with this method to gain intuition about how it works.
31573159
@@ -3248,8 +3250,9 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
32483250
32493251
"""
32503252
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)
32533256

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

pandas/core/series.py

+11-8
Original file line numberDiff line numberDiff line change
@@ -2747,9 +2747,9 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
27472747
regex : bool or same types as ``to_replace``, default False
27482748
Whether to interpret ``to_replace`` and/or ``value`` as regular
27492749
expressions. If this is ``True`` then ``to_replace`` *must* be a
2750-
string. Alternatively, this could be a regular expression or a list,
2751-
dict, or array of regular expressions in which case ``to_replace``
2752-
must be ``None``.
2750+
string. Alternatively, this could be a regular expression or a
2751+
list, dict, or array of regular expressions in which case
2752+
``to_replace`` must be ``None``.
27532753
method : string, optional, {'pad', 'ffill', 'bfill'}
27542754
The method to use when for replacement, when ``to_replace`` is a
27552755
``list``.
@@ -2766,13 +2766,15 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
27662766
Raises
27672767
------
27682768
AssertionError
2769-
* If ``regex`` is not a ``bool`` and ``to_replace`` is not ``None``.
2769+
* If ``regex`` is not a ``bool`` and ``to_replace`` is not
2770+
``None``.
27702771
TypeError
27712772
* If ``to_replace`` is a ``dict`` and ``value`` is not a ``list``,
27722773
``dict``, ``ndarray``, or ``Series``
2773-
* If ``to_replace`` is ``None`` and ``regex`` is not compilable into a
2774+
* If ``to_replace`` is ``None`` and ``regex`` is not compilable
2775+
into a
27742776
regular expression or is a list, dict, ndarray, or Series.
2775-
* When replacing multiple ``bool`` or ``datetime64`` objects and the
2777+
* When replacing multiple ``bool`` or ``datetime64`` objects and
27762778
the arguments to ``to_replace`` does not match the type of the
27772779
value being replaced
27782780
ValueError
@@ -2872,8 +2874,9 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
28722874
28732875
"""
28742876
return super(Series, self).replace(to_replace=to_replace, value=value,
2875-
inplace=inplace, limit=limit,
2876-
regex=regex, method=method, axis=axis)
2877+
inplace=inplace, limit=limit,
2878+
regex=regex, method=method,
2879+
axis=axis)
28772880

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

0 commit comments

Comments
 (0)