Skip to content

Commit d72cd70

Browse files
committed
fix some lint issues
1 parent a1db92c commit d72cd70

File tree

2 files changed

+25
-19
lines changed

2 files changed

+25
-19
lines changed

pandas/core/frame.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3156,9 +3156,9 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
31563156
regex : bool or same types as `to_replace`, default False
31573157
Whether to interpret ``to_replace`` and/or ``value`` as regular
31583158
expressions. If this is ``True`` then ``to_replace`` *must* be a
3159-
string. Alternatively, this could be a regular expression or a list,
3160-
dict, or array of regular expressions in which case ``to_replace``
3161-
must be ``None``.
3159+
string. Alternatively, this could be a regular expression or a
3160+
list, dict, or array of regular expressions in which case
3161+
``to_replace`` must be ``None``.
31623162
method : string, optional, {'pad', 'ffill', 'bfill'}
31633163
The method to use when for replacement, when ``to_replace`` is a
31643164
``list``.
@@ -3175,13 +3175,15 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
31753175
Raises
31763176
------
31773177
AssertionError
3178-
* If ``regex`` is not a ``bool`` and ``to_replace`` is not ``None``.
3178+
* If ``regex`` is not a ``bool`` and ``to_replace`` is not
3179+
``None``.
31793180
TypeError
31803181
* If ``to_replace`` is a ``dict`` and `value` is not a ``list``,
31813182
``dict``, ``ndarray``, or ``Series``
3182-
* If ``to_replace`` is ``None`` and ``regex`` is not compilable into a
3183-
regular expression or is a list, dict, ndarray, or Series.
3184-
* When replacing multiple ``bool`` or ``datetime64`` objects and the
3183+
* If ``to_replace`` is ``None`` and ``regex`` is not compilable
3184+
into a regular expression or is a list, dict, ndarray, or
3185+
Series.
3186+
* When replacing multiple ``bool`` or ``datetime64`` objects and
31853187
the arguments to `to_replace` does not match the type of the
31863188
value being replaced
31873189
ValueError
@@ -3195,8 +3197,8 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
31953197
* Regular expressions will only substitute on strings, meaning you
31963198
cannot provide, for example, a regular expression matching floating
31973199
point numbers and expect the columns in your frame that have a
3198-
numeric dtype to be matched. However, if those floating point numbers
3199-
*are* strings, then you can do this.
3200+
numeric dtype to be matched. However, if those floating point
3201+
numbers *are* strings, then you can do this.
32003202
* This method has *a lot* of options. You are encouraged to experiment
32013203
and play with this method to gain intuition about how it works.
32023204
@@ -3293,8 +3295,9 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
32933295
32943296
"""
32953297
return super(DataFrame, self).replace(to_replace=to_replace,
3296-
value=value, inplace=inplace, limit=limit, regex=regex,
3297-
method=method, axis=axis)
3298+
value=value, inplace=inplace,
3299+
limit=limit, regex=regex,
3300+
method=method, axis=axis)
32983301

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

pandas/core/series.py

Lines changed: 11 additions & 8 deletions
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)