@@ -391,16 +391,15 @@ def isin(comps, values) -> np.ndarray:
391
391
ndarray[bool]
392
392
Same length as `comps`.
393
393
"""
394
-
395
394
if not is_list_like (comps ):
396
395
raise TypeError (
397
- "only list-like objects are allowed to be passed"
398
- f" to isin(), you passed a [{ type (comps ).__name__ } ]"
396
+ "only list-like objects are allowed to be passed "
397
+ f"to isin(), you passed a [{ type (comps ).__name__ } ]"
399
398
)
400
399
if not is_list_like (values ):
401
400
raise TypeError (
402
- "only list-like objects are allowed to be passed"
403
- f" to isin(), you passed a [{ type (values ).__name__ } ]"
401
+ "only list-like objects are allowed to be passed "
402
+ f"to isin(), you passed a [{ type (values ).__name__ } ]"
404
403
)
405
404
406
405
if not isinstance (values , (ABCIndex , ABCSeries , np .ndarray )):
@@ -421,7 +420,7 @@ def isin(comps, values) -> np.ndarray:
421
420
422
421
# GH16012
423
422
# Ensure np.in1d doesn't get object types or it *may* throw an exception
424
- if len (comps ) > 1000000 and not is_object_dtype (comps ):
423
+ if len (comps ) > 1_000_000 and not is_object_dtype (comps ):
425
424
f = np .in1d
426
425
elif is_integer_dtype (comps ):
427
426
try :
@@ -833,8 +832,8 @@ def mode(values, dropna: bool = True) -> ABCSeries:
833
832
result = f (values , dropna = dropna )
834
833
try :
835
834
result = np .sort (result )
836
- except TypeError as e :
837
- warn (f"Unable to sort modes: { e } " )
835
+ except TypeError as err :
836
+ warn (f"Unable to sort modes: { err } " )
838
837
839
838
result = _reconstruct_data (result , original .dtype , original )
840
839
return Series (result )
@@ -1019,7 +1018,8 @@ def quantile(x, q, interpolation_method="fraction"):
1019
1018
values = np .sort (x )
1020
1019
1021
1020
def _interpolate (a , b , fraction ):
1022
- """Returns the point at the given fraction between a and b, where
1021
+ """
1022
+ Returns the point at the given fraction between a and b, where
1023
1023
'fraction' must be between 0 and 1.
1024
1024
"""
1025
1025
return a + (b - a ) * fraction
@@ -1192,7 +1192,8 @@ def compute(self, method):
1192
1192
)
1193
1193
1194
1194
def get_indexer (current_indexer , other_indexer ):
1195
- """Helper function to concat `current_indexer` and `other_indexer`
1195
+ """
1196
+ Helper function to concat `current_indexer` and `other_indexer`
1196
1197
depending on `method`
1197
1198
"""
1198
1199
if method == "nsmallest" :
@@ -1660,7 +1661,7 @@ def take_nd(
1660
1661
1661
1662
def take_2d_multi (arr , indexer , fill_value = np .nan ):
1662
1663
"""
1663
- Specialized Cython take which sets NaN values in one pass
1664
+ Specialized Cython take which sets NaN values in one pass.
1664
1665
"""
1665
1666
# This is only called from one place in DataFrame._reindex_multi,
1666
1667
# so we know indexer is well-behaved.
@@ -1988,8 +1989,8 @@ def sort_mixed(values):
1988
1989
1989
1990
if not is_list_like (codes ):
1990
1991
raise TypeError (
1991
- "Only list-like objects or None are allowed to be "
1992
- "passed to safe_sort as codes"
1992
+ "Only list-like objects or None are allowed to "
1993
+ "be passed to safe_sort as codes"
1993
1994
)
1994
1995
codes = ensure_platform_int (np .asarray (codes ))
1995
1996
0 commit comments