Skip to content

Commit 8ab24cd

Browse files
committed
fix some lint issues
1 parent 7142db6 commit 8ab24cd

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
@@ -3139,9 +3139,9 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
31393139
regex : bool or same types as `to_replace`, default False
31403140
Whether to interpret ``to_replace`` and/or ``value`` as regular
31413141
expressions. If this is ``True`` then ``to_replace`` *must* be a
3142-
string. Alternatively, this could be a regular expression or a list,
3143-
dict, or array of regular expressions in which case ``to_replace``
3144-
must be ``None``.
3142+
string. Alternatively, this could be a regular expression or a
3143+
list, dict, or array of regular expressions in which case
3144+
``to_replace`` must be ``None``.
31453145
method : string, optional, {'pad', 'ffill', 'bfill'}
31463146
The method to use when for replacement, when ``to_replace`` is a
31473147
``list``.
@@ -3158,13 +3158,15 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
31583158
Raises
31593159
------
31603160
AssertionError
3161-
* If ``regex`` is not a ``bool`` and ``to_replace`` is not ``None``.
3161+
* If ``regex`` is not a ``bool`` and ``to_replace`` is not
3162+
``None``.
31623163
TypeError
31633164
* If ``to_replace`` is a ``dict`` and `value` is not a ``list``,
31643165
``dict``, ``ndarray``, or ``Series``
3165-
* If ``to_replace`` is ``None`` and ``regex`` is not compilable into a
3166-
regular expression or is a list, dict, ndarray, or Series.
3167-
* When replacing multiple ``bool`` or ``datetime64`` objects and the
3166+
* If ``to_replace`` is ``None`` and ``regex`` is not compilable
3167+
into a regular expression or is a list, dict, ndarray, or
3168+
Series.
3169+
* When replacing multiple ``bool`` or ``datetime64`` objects and
31683170
the arguments to `to_replace` does not match the type of the
31693171
value being replaced
31703172
ValueError
@@ -3178,8 +3180,8 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
31783180
* Regular expressions will only substitute on strings, meaning you
31793181
cannot provide, for example, a regular expression matching floating
31803182
point numbers and expect the columns in your frame that have a
3181-
numeric dtype to be matched. However, if those floating point numbers
3182-
*are* strings, then you can do this.
3183+
numeric dtype to be matched. However, if those floating point
3184+
numbers *are* strings, then you can do this.
31833185
* This method has *a lot* of options. You are encouraged to experiment
31843186
and play with this method to gain intuition about how it works.
31853187
@@ -3276,8 +3278,9 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
32763278
32773279
"""
32783280
return super(DataFrame, self).replace(to_replace=to_replace,
3279-
value=value, inplace=inplace, limit=limit, regex=regex,
3280-
method=method, axis=axis)
3281+
value=value, inplace=inplace,
3282+
limit=limit, regex=regex,
3283+
method=method, axis=axis)
32813284

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

pandas/core/series.py

+11-8
Original file line numberDiff line numberDiff line change
@@ -2717,9 +2717,9 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
27172717
regex : bool or same types as ``to_replace``, default False
27182718
Whether to interpret ``to_replace`` and/or ``value`` as regular
27192719
expressions. If this is ``True`` then ``to_replace`` *must* be a
2720-
string. Alternatively, this could be a regular expression or a list,
2721-
dict, or array of regular expressions in which case ``to_replace``
2722-
must be ``None``.
2720+
string. Alternatively, this could be a regular expression or a
2721+
list, dict, or array of regular expressions in which case
2722+
``to_replace`` must be ``None``.
27232723
method : string, optional, {'pad', 'ffill', 'bfill'}
27242724
The method to use when for replacement, when ``to_replace`` is a
27252725
``list``.
@@ -2736,13 +2736,15 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
27362736
Raises
27372737
------
27382738
AssertionError
2739-
* If ``regex`` is not a ``bool`` and ``to_replace`` is not ``None``.
2739+
* If ``regex`` is not a ``bool`` and ``to_replace`` is not
2740+
``None``.
27402741
TypeError
27412742
* If ``to_replace`` is a ``dict`` and ``value`` is not a ``list``,
27422743
``dict``, ``ndarray``, or ``Series``
2743-
* If ``to_replace`` is ``None`` and ``regex`` is not compilable into a
2744+
* If ``to_replace`` is ``None`` and ``regex`` is not compilable
2745+
into a
27442746
regular expression or is a list, dict, ndarray, or Series.
2745-
* When replacing multiple ``bool`` or ``datetime64`` objects and the
2747+
* When replacing multiple ``bool`` or ``datetime64`` objects and
27462748
the arguments to ``to_replace`` does not match the type of the
27472749
value being replaced
27482750
ValueError
@@ -2842,8 +2844,9 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
28422844
28432845
"""
28442846
return super(Series, self).replace(to_replace=to_replace, value=value,
2845-
inplace=inplace, limit=limit,
2846-
regex=regex, method=method, axis=axis)
2847+
inplace=inplace, limit=limit,
2848+
regex=regex, method=method,
2849+
axis=axis)
28472850

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

0 commit comments

Comments
 (0)