@@ -1524,7 +1524,7 @@ def iterrows(self) -> Iterable[tuple[Hashable, Series]]:
15241524 """
15251525 columns = self .columns
15261526 klass = self ._constructor_sliced
1527- for k , v in zip (self .index , self .values ):
1527+ for k , v in zip (self .index , self .values , strict = True ):
15281528 s = klass (v , index = columns , name = k ).__finalize__ (self )
15291529 if self ._mgr .is_single_block :
15301530 s ._mgr .add_references (self ._mgr )
@@ -1607,10 +1607,10 @@ def itertuples(
16071607 itertuple = collections .namedtuple ( # type: ignore[misc]
16081608 name , fields , rename = True
16091609 )
1610- return map (itertuple ._make , zip (* arrays ))
1610+ return map (itertuple ._make , zip (* arrays , strict = True ))
16111611
16121612 # fallback to regular tuples
1613- return zip (* arrays )
1613+ return zip (* arrays , strict = True )
16141614
16151615 def __len__ (self ) -> int :
16161616 """
@@ -4359,7 +4359,7 @@ def _setitem_array(self, key, value) -> None:
43594359
43604360 if isinstance (value , DataFrame ):
43614361 check_key_length (self .columns , key , value )
4362- for k1 , k2 in zip (key , value .columns ):
4362+ for k1 , k2 in zip (key , value .columns , strict = False ):
43634363 self [k1 ] = value [k2 ]
43644364
43654365 elif not is_list_like (value ):
@@ -4465,7 +4465,7 @@ def _set_item_frame_value(self, key, value: DataFrame) -> None:
44654465 if len (cols_droplevel ) and not cols_droplevel .equals (value .columns ):
44664466 value = value .reindex (cols_droplevel , axis = 1 )
44674467
4468- for col , col_droplevel in zip (cols , cols_droplevel ):
4468+ for col , col_droplevel in zip (cols , cols_droplevel , strict = True ):
44694469 self [col ] = value [col_droplevel ]
44704470 return
44714471
@@ -6567,7 +6567,11 @@ class max type
65676567 names = self .index ._get_default_index_names (names , default )
65686568
65696569 if isinstance (self .index , MultiIndex ):
6570- to_insert = zip (reversed (self .index .levels ), reversed (self .index .codes ))
6570+ to_insert = zip (
6571+ reversed (self .index .levels ),
6572+ reversed (self .index .codes ),
6573+ strict = True ,
6574+ )
65716575 else :
65726576 to_insert = ((self .index , None ),)
65736577
@@ -7093,7 +7097,7 @@ def f(vals) -> tuple[np.ndarray, int]:
70937097 result .name = None
70947098 else :
70957099 vals = (col .values for name , col in self .items () if name in subset )
7096- labels , shape = map (list , zip (* map (f , vals )))
7100+ labels , shape = map (list , zip (* map (f , vals ), strict = True ))
70977101
70987102 ids = get_group_index (labels , tuple (shape ), sort = False , xnull = False )
70997103 result = self ._constructor_sliced (duplicated (ids , keep ), index = self .index )
@@ -7346,7 +7350,9 @@ def sort_values(
73467350
73477351 # need to rewrap columns in Series to apply key function
73487352 if key is not None :
7349- keys_data = [Series (k , name = name ) for (k , name ) in zip (keys , by )]
7353+ keys_data = [
7354+ Series (k , name = name ) for (k , name ) in zip (keys , by , strict = True )
7355+ ]
73507356 else :
73517357 # error: Argument 1 to "list" has incompatible type
73527358 # "Generator[ExtensionArray | ndarray[Any, Any], None, None]";
@@ -8208,7 +8214,7 @@ def _dispatch_frame_op(
82088214
82098215 arrays = [
82108216 array_op (_left , _right )
8211- for _left , _right in zip (self ._iter_column_arrays (), right )
8217+ for _left , _right in zip (self ._iter_column_arrays (), right , strict = True )
82128218 ]
82138219
82148220 elif isinstance (right , Series ):
@@ -11745,7 +11751,7 @@ def c(x):
1174511751 return nanops .nancorr (x [0 ], x [1 ], method = method )
1174611752
1174711753 correl = self ._constructor_sliced (
11748- map (c , zip (left .values .T , right .values .T )),
11754+ map (c , zip (left .values .T , right .values .T , strict = True )),
1174911755 index = left .columns ,
1175011756 copy = False ,
1175111757 )
0 commit comments