@@ -4892,12 +4892,12 @@ def sample(
4892
4892
if weights is not None :
4893
4893
4894
4894
# If a series, align with frame
4895
- if isinstance (weights , pd . Series ):
4895
+ if isinstance (weights , ABCSeries ):
4896
4896
weights = weights .reindex (self .axes [axis ])
4897
4897
4898
4898
# Strings acceptable if a dataframe and axis = 0
4899
4899
if isinstance (weights , str ):
4900
- if isinstance (self , pd . DataFrame ):
4900
+ if isinstance (self , ABCDataFrame ):
4901
4901
if axis == 0 :
4902
4902
try :
4903
4903
weights = self [weights ]
@@ -6628,7 +6628,7 @@ def replace(
6628
6628
to_replace = [to_replace ]
6629
6629
6630
6630
if isinstance (to_replace , (tuple , list )):
6631
- if isinstance (self , pd . DataFrame ):
6631
+ if isinstance (self , ABCDataFrame ):
6632
6632
return self .apply (
6633
6633
_single_replace , args = (to_replace , method , inplace , limit )
6634
6634
)
@@ -7421,7 +7421,7 @@ def _clip_with_one_bound(self, threshold, method, axis, inplace):
7421
7421
# be transformed to NDFrame from other array like structure.
7422
7422
if (not isinstance (threshold , ABCSeries )) and is_list_like (threshold ):
7423
7423
if isinstance (self , ABCSeries ):
7424
- threshold = pd . Series (threshold , index = self .index )
7424
+ threshold = self . _constructor (threshold , index = self .index )
7425
7425
else :
7426
7426
threshold = _align_method_FRAME (self , threshold , axis )
7427
7427
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
7510
7510
# so ignore
7511
7511
# GH 19992
7512
7512
# 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 )):
7514
7514
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 )):
7516
7516
upper = None
7517
7517
7518
7518
# GH 2747 (arguments were reversed)
@@ -8985,7 +8985,7 @@ def _where(
8985
8985
8986
8986
msg = "Boolean array expected for the condition, not {dtype}"
8987
8987
8988
- if not isinstance (cond , pd . DataFrame ):
8988
+ if not isinstance (cond , ABCDataFrame ):
8989
8989
# This is a single-dimensional object.
8990
8990
if not is_bool_dtype (cond ):
8991
8991
raise ValueError (msg .format (dtype = cond .dtype ))
0 commit comments