File tree 1 file changed +7
-13
lines changed
1 file changed +7
-13
lines changed Original file line number Diff line number Diff line change 44
44
is_datetime64tz_dtype ,
45
45
is_dict_like ,
46
46
is_extension_array_dtype ,
47
+ is_float ,
47
48
is_integer ,
48
49
is_list_like ,
49
50
is_number ,
@@ -1525,16 +1526,12 @@ def __pos__(self):
1525
1526
return self .__array_wrap__ (arr )
1526
1527
1527
1528
def __invert__ (self ):
1528
- try :
1529
- arr = operator .inv (com .values_from_object (self ))
1530
- return self .__array_wrap__ (arr )
1531
- except Exception :
1532
-
1529
+ if not self .size :
1533
1530
# inv fails with 0 len
1534
- if not np .prod (self .shape ):
1535
- return self
1531
+ return self
1536
1532
1537
- raise
1533
+ arr = operator .inv (com .values_from_object (self ))
1534
+ return self .__array_wrap__ (arr )
1538
1535
1539
1536
def __nonzero__ (self ):
1540
1537
raise ValueError (
@@ -5316,11 +5313,8 @@ def _check_inplace_setting(self, value):
5316
5313
if not self ._is_numeric_mixed_type :
5317
5314
5318
5315
# allow an actual np.nan thru
5319
- try :
5320
- if np .isnan (value ):
5321
- return True
5322
- except Exception :
5323
- pass
5316
+ if is_float (value ) and np .isnan (value ):
5317
+ return True
5324
5318
5325
5319
raise TypeError (
5326
5320
"Cannot do inplace boolean setting on "
You can’t perform that action at this time.
0 commit comments