@@ -391,16 +391,15 @@ def isin(comps, values) -> np.ndarray:
391391 ndarray[bool]
392392 Same length as `comps`.
393393 """
394-
395394 if not is_list_like (comps ):
396395 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__ } ]"
399398 )
400399 if not is_list_like (values ):
401400 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__ } ]"
404403 )
405404
406405 if not isinstance (values , (ABCIndex , ABCSeries , np .ndarray )):
@@ -421,7 +420,7 @@ def isin(comps, values) -> np.ndarray:
421420
422421 # GH16012
423422 # 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 ):
425424 f = np .in1d
426425 elif is_integer_dtype (comps ):
427426 try :
@@ -833,8 +832,8 @@ def mode(values, dropna: bool = True) -> ABCSeries:
833832 result = f (values , dropna = dropna )
834833 try :
835834 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 } " )
838837
839838 result = _reconstruct_data (result , original .dtype , original )
840839 return Series (result )
@@ -1019,7 +1018,8 @@ def quantile(x, q, interpolation_method="fraction"):
10191018 values = np .sort (x )
10201019
10211020 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
10231023 'fraction' must be between 0 and 1.
10241024 """
10251025 return a + (b - a ) * fraction
@@ -1192,7 +1192,8 @@ def compute(self, method):
11921192 )
11931193
11941194 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`
11961197 depending on `method`
11971198 """
11981199 if method == "nsmallest" :
@@ -1660,7 +1661,7 @@ def take_nd(
16601661
16611662def take_2d_multi (arr , indexer , fill_value = np .nan ):
16621663 """
1663- Specialized Cython take which sets NaN values in one pass
1664+ Specialized Cython take which sets NaN values in one pass.
16641665 """
16651666 # This is only called from one place in DataFrame._reindex_multi,
16661667 # so we know indexer is well-behaved.
@@ -1988,8 +1989,8 @@ def sort_mixed(values):
19881989
19891990 if not is_list_like (codes ):
19901991 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"
19931994 )
19941995 codes = ensure_platform_int (np .asarray (codes ))
19951996
0 commit comments