@@ -4892,12 +4892,12 @@ def sample(
48924892 if weights is not None :
48934893
48944894 # If a series, align with frame
4895- if isinstance (weights , pd . Series ):
4895+ if isinstance (weights , ABCSeries ):
48964896 weights = weights .reindex (self .axes [axis ])
48974897
48984898 # Strings acceptable if a dataframe and axis = 0
48994899 if isinstance (weights , str ):
4900- if isinstance (self , pd . DataFrame ):
4900+ if isinstance (self , ABCDataFrame ):
49014901 if axis == 0 :
49024902 try :
49034903 weights = self [weights ]
@@ -6628,7 +6628,7 @@ def replace(
66286628 to_replace = [to_replace ]
66296629
66306630 if isinstance (to_replace , (tuple , list )):
6631- if isinstance (self , pd . DataFrame ):
6631+ if isinstance (self , ABCDataFrame ):
66326632 return self .apply (
66336633 _single_replace , args = (to_replace , method , inplace , limit )
66346634 )
@@ -7421,7 +7421,7 @@ def _clip_with_one_bound(self, threshold, method, axis, inplace):
74217421 # be transformed to NDFrame from other array like structure.
74227422 if (not isinstance (threshold , ABCSeries )) and is_list_like (threshold ):
74237423 if isinstance (self , ABCSeries ):
7424- threshold = pd . Series (threshold , index = self .index )
7424+ threshold = self . _constructor (threshold , index = self .index )
74257425 else :
74267426 threshold = _align_method_FRAME (self , threshold , axis )
74277427 return self .where (subset , threshold , axis = axis , inplace = inplace )
@@ -7510,9 +7510,9 @@ def clip(self, lower=None, upper=None, axis=None, inplace=False, *args, **kwargs
75107510 # so ignore
75117511 # GH 19992
75127512 # numpy doesn't drop a list-like bound containing NaN
7513- if not is_list_like (lower ) and np .any (pd . isnull (lower )):
7513+ if not is_list_like (lower ) and np .any (isna (lower )):
75147514 lower = None
7515- if not is_list_like (upper ) and np .any (pd . isnull (upper )):
7515+ if not is_list_like (upper ) and np .any (isna (upper )):
75167516 upper = None
75177517
75187518 # GH 2747 (arguments were reversed)
@@ -8985,7 +8985,7 @@ def _where(
89858985
89868986 msg = "Boolean array expected for the condition, not {dtype}"
89878987
8988- if not isinstance (cond , pd . DataFrame ):
8988+ if not isinstance (cond , ABCDataFrame ):
89898989 # This is a single-dimensional object.
89908990 if not is_bool_dtype (cond ):
89918991 raise ValueError (msg .format (dtype = cond .dtype ))
0 commit comments