@@ -240,7 +240,7 @@ class NDFrame(PandasObject, SelectionMixin, indexing.IndexingMixin):
240
240
def __init__ (
241
241
self ,
242
242
data : Manager ,
243
- copy : bool = False ,
243
+ copy : bool_t = False ,
244
244
attrs : Optional [Mapping [Hashable , Any ]] = None ,
245
245
):
246
246
# copy kwarg is retained for mypy compat, is not used
@@ -257,7 +257,7 @@ def __init__(
257
257
258
258
@classmethod
259
259
def _init_mgr (
260
- cls , mgr , axes , dtype : Optional [Dtype ] = None , copy : bool = False
260
+ cls , mgr , axes , dtype : Optional [Dtype ] = None , copy : bool_t = False
261
261
) -> Manager :
262
262
""" passed a manager and a axes dict """
263
263
for a , axe in axes .items ():
@@ -385,8 +385,8 @@ def flags(self) -> Flags:
385
385
def set_flags (
386
386
self : FrameOrSeries ,
387
387
* ,
388
- copy : bool = False ,
389
- allows_duplicate_labels : Optional [bool ] = None ,
388
+ copy : bool_t = False ,
389
+ allows_duplicate_labels : Optional [bool_t ] = None ,
390
390
) -> FrameOrSeries :
391
391
"""
392
392
Return a new object with updated flags.
@@ -475,7 +475,7 @@ def _data(self):
475
475
_stat_axis_name = "index"
476
476
_AXIS_ORDERS : List [str ]
477
477
_AXIS_TO_AXIS_NUMBER : Dict [Axis , int ] = {0 : 0 , "index" : 0 , "rows" : 0 }
478
- _AXIS_REVERSED : bool
478
+ _AXIS_REVERSED : bool_t
479
479
_info_axis_number : int
480
480
_info_axis_name : str
481
481
_AXIS_LEN : int
@@ -502,7 +502,7 @@ def _construct_axes_dict(self, axes=None, **kwargs):
502
502
@final
503
503
@classmethod
504
504
def _construct_axes_from_arguments (
505
- cls , args , kwargs , require_all : bool = False , sentinel = None
505
+ cls , args , kwargs , require_all : bool_t = False , sentinel = None
506
506
):
507
507
"""
508
508
Construct and returns axes if supplied in args/kwargs.
@@ -722,11 +722,11 @@ def set_axis(self: FrameOrSeries, labels, *, inplace: Literal[True]) -> None:
722
722
723
723
@overload
724
724
def set_axis (
725
- self : FrameOrSeries , labels , axis : Axis = ..., inplace : bool = ...
725
+ self : FrameOrSeries , labels , axis : Axis = ..., inplace : bool_t = ...
726
726
) -> Optional [FrameOrSeries ]:
727
727
...
728
728
729
- def set_axis (self , labels , axis : Axis = 0 , inplace : bool = False ):
729
+ def set_axis (self , labels , axis : Axis = 0 , inplace : bool_t = False ):
730
730
"""
731
731
Assign desired index to given axis.
732
732
@@ -757,7 +757,7 @@ def set_axis(self, labels, axis: Axis = 0, inplace: bool = False):
757
757
return self ._set_axis_nocheck (labels , axis , inplace )
758
758
759
759
@final
760
- def _set_axis_nocheck (self , labels , axis : Axis , inplace : bool ):
760
+ def _set_axis_nocheck (self , labels , axis : Axis , inplace : bool_t ):
761
761
# NDFrame.rename with inplace=False calls set_axis(inplace=True) on a copy.
762
762
if inplace :
763
763
setattr (self , self ._get_axis_name (axis ), labels )
@@ -1003,8 +1003,8 @@ def rename(
1003
1003
index : Optional [Renamer ] = None ,
1004
1004
columns : Optional [Renamer ] = None ,
1005
1005
axis : Optional [Axis ] = None ,
1006
- copy : bool = True ,
1007
- inplace : bool = False ,
1006
+ copy : bool_t = True ,
1007
+ inplace : bool_t = False ,
1008
1008
level : Optional [Level ] = None ,
1009
1009
errors : str = "ignore" ,
1010
1010
) -> Optional [FrameOrSeries ]:
@@ -1410,13 +1410,13 @@ def _set_axis_name(self, name, axis=0, inplace=False):
1410
1410
# Comparison Methods
1411
1411
1412
1412
@final
1413
- def _indexed_same (self , other ) -> bool :
1413
+ def _indexed_same (self , other ) -> bool_t :
1414
1414
return all (
1415
1415
self ._get_axis (a ).equals (other ._get_axis (a )) for a in self ._AXIS_ORDERS
1416
1416
)
1417
1417
1418
1418
@final
1419
- def equals (self , other : object ) -> bool :
1419
+ def equals (self , other : object ) -> bool_t :
1420
1420
"""
1421
1421
Test whether two objects contain the same elements.
1422
1422
@@ -5078,15 +5078,15 @@ def filter(
5078
5078
return self .reindex (** {name : [r for r in items if r in labels ]})
5079
5079
elif like :
5080
5080
5081
- def f (x ) -> bool :
5081
+ def f (x ) -> bool_t :
5082
5082
assert like is not None # needed for mypy
5083
5083
return like in ensure_str (x )
5084
5084
5085
5085
values = labels .map (f )
5086
5086
return self .loc (axis = axis )[values ]
5087
5087
elif regex :
5088
5088
5089
- def f (x ) -> bool :
5089
+ def f (x ) -> bool_t :
5090
5090
return matcher .search (ensure_str (x )) is not None
5091
5091
5092
5092
matcher = re .compile (regex )
0 commit comments