diff --git a/pandas/core/internals/array_manager.py b/pandas/core/internals/array_manager.py index 407e16e1fa187..0925f3a3cee1f 100644 --- a/pandas/core/internals/array_manager.py +++ b/pandas/core/internals/array_manager.py @@ -834,7 +834,7 @@ def iset( # multiple columns -> convert slice or array to integer indices elif isinstance(loc, slice): - indices = range( + indices: range | np.ndarray = range( loc.start if loc.start is not None else 0, loc.stop if loc.stop is not None else self.shape_proper[1], loc.step if loc.step is not None else 1, @@ -842,9 +842,7 @@ def iset( else: assert isinstance(loc, np.ndarray) assert loc.dtype == "bool" - # error: Incompatible types in assignment (expression has type "ndarray", - # variable has type "range") - indices = np.nonzero(loc)[0] # type: ignore[assignment] + indices = np.nonzero(loc)[0] assert value.ndim == 2 assert value.shape[0] == len(self._axes[0])