Skip to content

Commit 1b74363

Browse files
committed
fix some lint issues
1 parent d7c8a77 commit 1b74363

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
@@ -3143,9 +3143,9 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
31433143
regex : bool or same types as `to_replace`, default False
31443144
Whether to interpret ``to_replace`` and/or ``value`` as regular
31453145
expressions. If this is ``True`` then ``to_replace`` *must* be a
3146-
string. Alternatively, this could be a regular expression or a list,
3147-
dict, or array of regular expressions in which case ``to_replace``
3148-
must be ``None``.
3146+
string. Alternatively, this could be a regular expression or a
3147+
list, dict, or array of regular expressions in which case
3148+
``to_replace`` must be ``None``.
31493149
method : string, optional, {'pad', 'ffill', 'bfill'}
31503150
The method to use when for replacement, when ``to_replace`` is a
31513151
``list``.
@@ -3162,13 +3162,15 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
31623162
Raises
31633163
------
31643164
AssertionError
3165-
* If ``regex`` is not a ``bool`` and ``to_replace`` is not ``None``.
3165+
* If ``regex`` is not a ``bool`` and ``to_replace`` is not
3166+
``None``.
31663167
TypeError
31673168
* If ``to_replace`` is a ``dict`` and `value` is not a ``list``,
31683169
``dict``, ``ndarray``, or ``Series``
3169-
* If ``to_replace`` is ``None`` and ``regex`` is not compilable into a
3170-
regular expression or is a list, dict, ndarray, or Series.
3171-
* When replacing multiple ``bool`` or ``datetime64`` objects and the
3170+
* If ``to_replace`` is ``None`` and ``regex`` is not compilable
3171+
into a regular expression or is a list, dict, ndarray, or
3172+
Series.
3173+
* When replacing multiple ``bool`` or ``datetime64`` objects and
31723174
the arguments to `to_replace` does not match the type of the
31733175
value being replaced
31743176
ValueError
@@ -3182,8 +3184,8 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
31823184
* Regular expressions will only substitute on strings, meaning you
31833185
cannot provide, for example, a regular expression matching floating
31843186
point numbers and expect the columns in your frame that have a
3185-
numeric dtype to be matched. However, if those floating point numbers
3186-
*are* strings, then you can do this.
3187+
numeric dtype to be matched. However, if those floating point
3188+
numbers *are* strings, then you can do this.
31873189
* This method has *a lot* of options. You are encouraged to experiment
31883190
and play with this method to gain intuition about how it works.
31893191
@@ -3280,8 +3282,9 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
32803282
32813283
"""
32823284
return super(DataFrame, self).replace(to_replace=to_replace,
3283-
value=value, inplace=inplace, limit=limit, regex=regex,
3284-
method=method, axis=axis)
3285+
value=value, inplace=inplace,
3286+
limit=limit, regex=regex,
3287+
method=method, axis=axis)
32853288

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

pandas/core/series.py

+11-8
Original file line numberDiff line numberDiff line change
@@ -2730,9 +2730,9 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
27302730
regex : bool or same types as ``to_replace``, default False
27312731
Whether to interpret ``to_replace`` and/or ``value`` as regular
27322732
expressions. If this is ``True`` then ``to_replace`` *must* be a
2733-
string. Alternatively, this could be a regular expression or a list,
2734-
dict, or array of regular expressions in which case ``to_replace``
2735-
must be ``None``.
2733+
string. Alternatively, this could be a regular expression or a
2734+
list, dict, or array of regular expressions in which case
2735+
``to_replace`` must be ``None``.
27362736
method : string, optional, {'pad', 'ffill', 'bfill'}
27372737
The method to use when for replacement, when ``to_replace`` is a
27382738
``list``.
@@ -2749,13 +2749,15 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
27492749
Raises
27502750
------
27512751
AssertionError
2752-
* If ``regex`` is not a ``bool`` and ``to_replace`` is not ``None``.
2752+
* If ``regex`` is not a ``bool`` and ``to_replace`` is not
2753+
``None``.
27532754
TypeError
27542755
* If ``to_replace`` is a ``dict`` and ``value`` is not a ``list``,
27552756
``dict``, ``ndarray``, or ``Series``
2756-
* If ``to_replace`` is ``None`` and ``regex`` is not compilable into a
2757+
* If ``to_replace`` is ``None`` and ``regex`` is not compilable
2758+
into a
27572759
regular expression or is a list, dict, ndarray, or Series.
2758-
* When replacing multiple ``bool`` or ``datetime64`` objects and the
2760+
* When replacing multiple ``bool`` or ``datetime64`` objects and
27592761
the arguments to ``to_replace`` does not match the type of the
27602762
value being replaced
27612763
ValueError
@@ -2855,8 +2857,9 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
28552857
28562858
"""
28572859
return super(Series, self).replace(to_replace=to_replace, value=value,
2858-
inplace=inplace, limit=limit,
2859-
regex=regex, method=method, axis=axis)
2860+
inplace=inplace, limit=limit,
2861+
regex=regex, method=method,
2862+
axis=axis)
28602863

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

0 commit comments

Comments
 (0)