Skip to content

Commit 103d1fe

Browse files
dedent in _set_value
1 parent ce0649b commit 103d1fe

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

pandas/core/frame.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -3924,14 +3924,15 @@ def _set_value(
39243924
# setitem will do validation that may raise TypeError,
39253925
# ValueError, or LossySetitemError
39263926
if takeable:
3927-
# error: Argument 2 to "column_setitem" of "BlockManager" has
3928-
# incompatible type "Union[Hashable, Sequence[Hashable]]";
3929-
# expected "Union[int, slice, ndarray[Any, Any]]"
3930-
self._mgr.column_setitem(col, index, value) # type: ignore[arg-type]
3927+
icol = col
3928+
iindex = index
39313929
else:
39323930
icol = self.columns.get_loc(col)
3933-
index = self.index.get_loc(index)
3934-
self._mgr.column_setitem(icol, index, value) # type: ignore[arg-type]
3931+
iindex = self.index.get_loc(index)
3932+
# error: Argument 2 to "column_setitem" of "BlockManager" has
3933+
# incompatible type "Union[Hashable, Sequence[Hashable]]";
3934+
# expected "Union[int, slice, ndarray[Any, Any]]"
3935+
self._mgr.column_setitem(icol, iindex, value) # type: ignore[arg-type]
39353936
self._clear_item_cache()
39363937

39373938
except (KeyError, TypeError, ValueError, LossySetitemError):

0 commit comments

Comments
 (0)