Skip to content

Commit

Permalink
FEAT-modin-project#7207: Add the ability to assing a df to a columns …
Browse files Browse the repository at this point in the history
…selection without d2p

Signed-off-by: Igoshev, Iaroslav <[email protected]>
  • Loading branch information
YarShev committed Apr 22, 2024
1 parent 3abd961 commit 97ea4bf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modin/pandas/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -2671,7 +2671,9 @@ def __setitem__(self, key, value) -> None:
key = self.__constructor__(key, columns=self.columns)
return self.mask(key, value, inplace=True)

if isinstance(key, list) and all((x in self.columns for x in key)):
if isinstance(key, (list, pandas.Index)) and all(
(x in self.columns for x in key)
):
if is_list_like(value):
if not (hasattr(value, "shape") and hasattr(value, "ndim")):
value = np.array(value)
Expand Down

0 comments on commit 97ea4bf

Please sign in to comment.