@@ -625,7 +625,7 @@ def get_iterator(self, data: NDFrameT) -> Iterator[tuple[Hashable, NDFrameT]]:
625
625
splitter = self ._get_splitter (data )
626
626
# TODO: Would be more efficient to skip unobserved for transforms
627
627
keys = self .result_index
628
- yield from zip (keys , splitter )
628
+ yield from zip (keys , splitter , strict = True )
629
629
630
630
@final
631
631
def _get_splitter (self , data : NDFrame ) -> DataSplitter :
@@ -766,7 +766,7 @@ def result_index_and_ids(self) -> tuple[Index, npt.NDArray[np.intp]]:
766
766
]
767
767
sorts = [ping ._sort for ping in self .groupings ]
768
768
# When passed a categorical grouping, keep all categories
769
- for k , (ping , level ) in enumerate (zip (self .groupings , levels )):
769
+ for k , (ping , level ) in enumerate (zip (self .groupings , levels , strict = True )):
770
770
if ping ._passed_categorical :
771
771
levels [k ] = level .set_categories (ping ._orig_cats )
772
772
@@ -997,7 +997,7 @@ def apply_groupwise(
997
997
result_values = []
998
998
999
999
# This calls DataSplitter.__iter__
1000
- zipped = zip (group_keys , splitter )
1000
+ zipped = zip (group_keys , splitter , strict = True )
1001
1001
1002
1002
for key , group in zipped :
1003
1003
# Pinning name is needed for
@@ -1095,7 +1095,7 @@ def groups(self):
1095
1095
# GH 3881
1096
1096
result = {
1097
1097
key : value
1098
- for key , value in zip (self .binlabels , self .bins )
1098
+ for key , value in zip (self .binlabels , self .bins , strict = True )
1099
1099
if key is not NaT
1100
1100
}
1101
1101
return result
@@ -1126,7 +1126,7 @@ def get_iterator(self, data: NDFrame):
1126
1126
slicer = lambda start , edge : data .iloc [start :edge ]
1127
1127
1128
1128
start : np .int64 | int = 0
1129
- for edge , label in zip (self .bins , self .binlabels ):
1129
+ for edge , label in zip (self .bins , self .binlabels , strict = True ):
1130
1130
if label is not NaT :
1131
1131
yield label , slicer (start , edge )
1132
1132
start = edge
@@ -1139,7 +1139,7 @@ def indices(self):
1139
1139
indices = collections .defaultdict (list )
1140
1140
1141
1141
i : np .int64 | int = 0
1142
- for label , bin in zip (self .binlabels , self .bins ):
1142
+ for label , bin in zip (self .binlabels , self .bins , strict = True ):
1143
1143
if i < bin :
1144
1144
if label is not NaT :
1145
1145
indices [label ] = list (range (i , bin ))
@@ -1229,7 +1229,7 @@ def __iter__(self) -> Iterator:
1229
1229
1230
1230
starts , ends = lib .generate_slices (self ._slabels , self .ngroups )
1231
1231
sdata = self ._sorted_data
1232
- for start , end in zip (starts , ends ):
1232
+ for start , end in zip (starts , ends , strict = True ):
1233
1233
yield self ._chop (sdata , slice (start , end ))
1234
1234
1235
1235
@cache_readonly
0 commit comments